Java For Life..Part-4

 Rules For Writing Identifiers in Java:-

    1) An identifier does not contain Spaces.
    2)An identifier doesnot start with a Digits.
    3)It cannot have special characters except underscore(_),$
    4)Keywords of java cant be used as identifier.
    5)You can have the identifier  with any length & it is suggested upto   16 [sixteen] characters.
    6) You can have any name as identifier ,but it must be  apt to the application.

  Comments  in Java:-

    Comments in program  will explain the code .these are required for better  readibility. of the                 application..
       We have   three [3]  types of comments in  java.
   1) Single Line  Comment .
   2)Multi Line Comment.
   3)Documentation Comment.

 Single Line Comment:-

   It is used to provide the comments only in one line.
  • these comments will be started with  //  and ends with // with in the same line.
       EX:- // this is single line//.

  Multiple Line Comment:-

    By using  this we can provide the comments in  multiple lines.
  • These  comments will be started with /* ends with*/
  1. EX:- /* this is line one */

 Documentation Line:-

    These are used to create a  API. [Application Program Enterprise]
  1.     These comments will be start with /**  ends with */

 Keywords:-

  keyword is a pre-defined  word which has special meanings  in  java  are called keywords of java..
  EX:- class , public, void, char, int, etc.,..
  Note:- there are only  50 [fifty] keywords  available in java..




No comments:

Post a Comment