Index

chapter1

chapter2page2

chapter2page3

chapter2page4

chapter2page5

chapter2page6

chapter2page7

chapter2page8

chapter2page9

chapter2page10

chapter2page11

chapter2page12

chapter2page13

chapter2page14

chapter2page15

chapter2page16

chapter2page17

chapter2page18

chapter2page19

chapter2page20

chapter2page21

chapter2page22

chapter2page23

chapter2page24

chapter2page25

chapter2page26

chapter2page27

chapter2page28

chapter2page29

chapter2page30

chapter2page31

chapter2page32

chapter2page33

chapter2page34

chapter3

link one

link one

link one

link one

link one

link one

2 - Core Java Language

Core Java Language elements are all the elements of the Java language used for all the programming tasks of the Java Language. Therefore this chapter has a broadest span in Java Language tutorials. Despite it's magnitude, this is perhaps the most easy learning chapter of the Java lessons, because it is not intended to introduce any specific programming concepts. Here only the syntax rules and semantics of the Java Language is presented and these are all well documented in the online documentation, both from official as well as from third party sites. Also Eclipse, Netbeans and some other IDEs have some form of code assistance to help programmers for producing correct codes.

In Short, this is a read-apply chapter and there will be plenty of appications. We will much resort to Eclipse abilities for developing our applications. This the right place for us to know about Java and gain proficiency for producing stand-alone Java programs. Please try to learn as you breath the theory and practice presented here.

2.1 - Unicode Support of the Java Language, Java Keywords and Java Identifiers

2.1.1 -Unicode Support of the Java Language

Java programming language, with the release of Java 7 supports the the new Unicode standard version 6.0.0. Unicode has updated to the version 6.0.1 for minor changes. But Java stayed actually at 6.0.0. This is covering almost any character from dead and living languages that means Java is supporting actually any localisation envisaged. But, unless aimed specifically, it is very advisable to stick on what we have in the keyboard. But remember, there is a special keyboard layout to suit most of the major languages in the world.

2.1.2 - Java Reserved Words

Java reserved words are listed below. These keywords may not be used for any other purpose in the Java Programs.

Java Reserved Words

abstract assert boolean
break byte case
catch char class
continue default do
double else enum
extends final finally
float for if
implements import instanceof
int interface long
native new package
private protected; public
return short static
strictfp super switch
synchronized this throw
throws transient try
void volatile while

Keywords That Are Not Currently Used

2.1.3 - Java Identifiers

In any program language, identifiers are used to name different language elements like variables, arrays, classes, instances of the classes, methods etc... Java with his Unicode support, understands any Unicode character used in ─▒dentifiers. Meanwhile, it is better to use what we have in the keyboard, simply because directly typing Unicode entry points as hex values is not feasible. This will induce too much typing and ─▒t is error prone. Therefore, it is highly advisable to use only the characters we have as keyboard buttons when composing the idenfiers. But in rare cases when we are in need to use Unicode entry points, use them sparingly.

In the identifier composition, after the first letter, any combination of Unicode characters, numeric digits, underscore or dollar sign may be applied.

As all the programming languages, Java also impose some restrictions for the composition of idenfiers. These are shown below:

 

In Java the length of an identifier is not limited. Java Code Conventions suggest using meaningful names. Longer identifier names result higher number of keyboard strokes and that is why we should keep ourselves for composing unnecessary lengthy identifiers. Using meaningful names in identifiers enhance the readability of the program in the maintenance stage. According to Sun, the inventor and the former owner of Java, only %20 of the total cost of the program accounts for design, the remaining part acccounts for maintenance. The maintenance stage is thus very important and the person who carries the maintenance is generally not the author who has written the program. The codes of the program must be clear, readable and well commented to facilitate the maintenance work.

Java is case sensitive programming language. HelloWorld is considered completely different from helloworld.

Some legal identifier examples are given below,

These rules are more or less the same with every major programming language. But, it may also worth to add some warnings with what are permitted:

* Java identifiers may begin with an underscore like _FirstAddress.

Better not, since the underscore character may be missed and this may cause faulty calls.

* Java identifiers may begin with a dollar sign like $Sum.

Better not, because Java source codes may may be confused with those of Perl or Php.

* Java identifiers may include Unicode entry points as hex literals.

Better not, because that will bring too much typing and may lead to confusion.

<< Index

Polyglott HTML5(XHTML5 compliant HTML5 code)