Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 792 Bytes

File metadata and controls

35 lines (23 loc) · 792 Bytes

Access Modifiers :

Public - accessible from all classes
Private - only in same class
Protected - subclasses and classes in same package
default - classes in same package

Compiling the code : -d is used to specify the directory where the .class should be placed -cp means classpath where classesa are generated

Whole Numbers :
byte - 8 bits
short - 16 bits
int - 32 bits
long - 64 bits (ends with L/l)

  • we can represent binary values using int 0b101010 -- 42
  • ~a = -(a+1)

Float pointing numbers :
float - 32 bits (ends with F/f)
double - 64 bits

Character :
char - 16 bits (default value : '\u0000')

  • we can increment char value char x = 'm'; x++;

Boolean :
bool