CSE310 Java
myclass.lpu.in
course :
Programming in Java CSE310 2024
17 feb, ca 1 : Unit one and Unit two.
5/2
Primitive variable: They stored directly in the memory and they store simple data values which are not associated with any objects or classes. There are eight different primitive data types. boolean, byte, char, short, int, long, float, double.
int x= 0;
double d = 13.33;
Double marks = Double NaN;
Sout(Double.isNaN(marks);
This is showing as Not a number. When we try to assign marks of students and we just don't want to assign any number yet we use NaN.
Reference variable: holds referencs(memory addresses) to object or instances of classes.
String S = null;
Date d = null;
int[] x;
We use null to reference variable because we don't want to assign any value to the variable yet.
Comments
Post a Comment