Skip to main content

Posts

Showing posts from October, 2019

DATA TYPES

DATA TYPES:- Every variable has a type, every expression has a type and all types are strictly define more over every assignment should be checked by the compiler by the type compatibility hence java language is considered as strongly typed programming language . Java is pure object oriented programming or not?     Java is not considered as pure object oriented programming language because several oops features (like multiple inheritance, operator overloading) are not supported by java moreover we are depending on primitive data types which are non objects.  Diagram:  Except Boolean and char all remaining data types are considered as signed data types because we can represent both "+ve" and"-ve" numbers.  Integral data types : Byte: Size:  1byte (8bits) Maxvalue:  +127  Minvalue: -128  Range: - 128to 127[ 2 7  to  2 7 -1] The most significant bit acts as sign bit. "0" means "+ve" number and "1"

RESERVED WORDS

RESERVED WORDS: In java some identifiers are reserved to associate some functionality or meaning such type of reserved identifiers are called reserved words. Diagram: Reserved words for data types: (8)  byte  short  int  long  float   double  char  boolean Reserved words for flow control:(11) if   else  switch   case default  for do  while  break  continue   return   Keywords for modifiers:(11) public  private  protected  static  final abstract synchronized native   strictfp(1.2 version)  transient volatile Keywords for exception handling:(6) try  catch  finally  throw  throws  assert(1.4 version) Class related keywords:(6) class  package  import  extends  implements  interface  Object related keywords:(4) new instanceof  super  this Void return type keyword: If a method won't return anything compulsory that method should be declared with the void return type in java but it is optional