Thank You For Coming My Blog. This Blog is Everyone so You Read and Share another...

Saturday, November 10, 2018

java programming

History of Java:

James Gosling initiated the Java language project in June 1991 for use in one of his many set-top box projects. The  language,  initially  called  Oak  after  an  oak  tree  that  stood  outside  Gosling's  office,  also  went  by  the  name Green and ended up later being renamed as Java, from a list of random words.
Sun  released  the  first  public  implementation  as  Java  1.0  in  1995.  It  promised Write  Once,  Run
Anywhere (WORA), providing no-cost run-times on popular platforms.
On 13 November 2006, Sun released much of Java as free and open source software under the terms of the GNU General Public License (GPL)

Java Identifiers:
All Java components require names. Names used for classes, variables and methods are called identifiers.
In Java, there are several points to remember about identifiers. They are as follows:
  • All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore (_).
  • After the first character, identifiers can have any combination of characters.
  • A keyword cannot be used as an identifier.
  • Most importantly identifiers are case sensitive.
  • Examples of legal identifiers:age, $salary, _value, __1_value
  • Examples of illegal identifiers: 123abc, -salary

Java Modifiers:
Like other languages,  it is possible to modify classes, methods ,  etc.,  by using modifiers. There are two categories of modifiers:
  • Access Modifiers: default, public, protected, private
  • Non-access Modifiers: final, abstract, strictfp

Java Variables:
We would see following type of variables in Java:
  • Local Variables
  • Class Variables (Static Variables)
  • Instance Variables (Non-static variables)
Java Arrays:
Arrays are objects that store multiple variables of the same type. However,  an array itself is an object on the heap.

Java Enums:
Enums were introduced in java 5.0. Enums restrict a variable to have one of only a few predefined values. The values in this enumerated list are called enums.With the use of enums, it is possible to reduce the number of bugs in your code.

No comments:

Post a Comment