Skip to main content

Posts

Showing posts with the label Constants

Variables & Data Types (Lecture 2) | Primitive Data Types| Non-Primitive Data types

          Java - Introduction to Programming Lecture 2 Variables & Data Types Variables A variable is a container (storage area) used to hold data.   Each variable should be given a unique name (identifier). package com.apnacollege ; public class Main {     public static void main (String[] args) {        // Variables         String name = "Aman" ;        int age = 30 ;         String neighbour = "Akku" ;         String friend = neighbour ;     } } Data Types Data types are declarations for variables. This determines the type and size of  data associated with variables which is essential to know since different data  types occupy different sizes of memory. There are 2 types of Data Types : Primitive...