X

Play AlgoQuiz

Rate Us :



Share with Friends :

Menu

X

convey :

It refers to express a thought, feeling, or idea so that it is understood by others.

X

recognized :

It refers to identify (someone or something).

Reserved Words :-

Java language related words are called 'reserved words'. It is a reserved or pre-defined words that convey some special meaning in language compiler. These words are recognized by Java compiler or Java runtime(JVM).


Reserved words are of two types :-

  • Keywords




  • Reserved Literals




Keywords are of two types :-

  • Used keywords




  • Unused keywords




Used keywords are :-

Data Types :

  • int




  • short




  • long




  • float




  • char




  • double




  • boolean




  • byte




Control Statements :

  • if




  • else




  • if-else




  • switch




  • case




  • default




  • for




  • while




  • do




  • break




  • continue




  • return




Modifiers :

  • public




  • protected




  • private




  • abstract




  • final




  • static




  • transient




  • synchronized




  • volatile




  • strictfp




  • native




Exception :

  • try




  • catch




  • finally




  • throw




  • throws




  • assert




Packages :

  • import




  • package




Class related types :

  • class




  • interface




  • enum




Inheritance :

  • extends




  • implements




References :

  • this




  • super




  • instanceof




Unused keywords are :-

  • goto




  • const




Reserved Literals are :-

  • true




  • false




  • null




Identifiers :-

It is a name given to the different parts of program. It is a user-defined word. Identifier is a collection of alphabets, digits & allows two special characters(i.e. $,_). The identifiers contain certain rule called 'Hungarian notation'.


Rules for Identifiers :-

  • It can have alphabets, digits and underscore and dollar symbol.

Example :

int a1; // valid int roll_no; // valid int abc; // valid int $; // valid

  • They must not be a keyword or boolean literal or null.

Example :

int null; // invalid int true; // invalid

  • They must not begin with a digit.

  • Can be of any length.

  • Java is case sensitive so upper-case letters and lower-case letters are different.

Naming Conventions :-

  • Identifiers should begin with lower-case letters.

  • In case of multiple words the first alphabet of second word and it's substitute word are in capital letters.

  • Private and local variables should be in lower-case letters.

  • Class name and interface name begins with an upper-case letter.

  • Constant name will be in capital letters with underscore separating two words.

Literal :-

Literals are fixed data items having fixed values.


Types of literals :

  • Integer literal




  • Character literal




  • Floating literal




  • String literal




  • Boolean literal




Integer Literal :-

It contain integer values.

Example :

int a = 123; int b = 567;


Character Literal :-

It contains one character and must be enclosed in single quotation(' ').

Example :

char a = 'A'; char b = '2';


Floating Literal :-

It contain floating or real values.

Example :

float a = 123.0; float b = 567.0;


String Literal :-

It contain sequence of zero or more characters within double quotation(" ").

Example :

String a = "Computer"; String b = "A";


Boolean Literal :-

It contain either true or false.

Example :

boolean a = true; boolean b = false;


Escape Sequence :-

For displaying or using some non-graphical character that cannot be typed directly from the keyboard like : backspace, tab, enter key etc. It can be represented by escape sequence. Escape sequence uses backslash(\) to represent the non-graphic character.

Example :

\n - for new line \t - for horizontal tab \b - for backslash space \0 - for null \' - for quotation


Punctuator or Separator :-

  • Parenthesis ( )




  • Square Bracket [ ]




  • Curly Braces { }




  • Semi Colon ;




  • Comma ,




  • Dot .






X

MiniDoll :

MiniDoll is an application to learn with fun. You can play it to solve some tricky questions related to Java Programming. Either enjoy playing it alone or discuss with your friends to solve it. It is a simple approach to learn by solving questions. This application has different topics of Java and each topic is divided into three phases. Start solving from initial topic to final topic and by the end of every topic you can boost your concept of that topic.