Friday, December 18, 2009

Core Java - Insight

Introduction:

Java is an interpreted language. When you write a Java program, either in a development environment or in a text editor, it needs to be compiled into an optimized set of instructions called a Byte Code. This byte code is platform independent and cannot be executed directly by the processor. Instead, a Java Virtual Machine(JVM) runs(interprets) the byte code. There are JVMs available for variety of platforms.

JDK includes these tools:
Tool Use
Javac Java compiler
Java Java interpreter, used to run compiled program
Appletviewer Used for displaying the applet as it would be seen by the browser
Jdb Debugger
Javadoc Documentation Generator

Operators:

Precedence Table in Java :
OperatorsPrecedence
postfixexpr++ expr--
unary++expr --expr +expr -expr ~ !
multiplicative* / %
additive+ -
shift<< >> >>>
relational< > <= >= instanceof
equality== !=
bitwise AND&
bitwise exclusive OR^
bitwise inclusive OR|
logical AND&&
logical OR||
ternary? :
assignment= += -= *= /= %= &= ^= |= <<= >>= >>>=

- Explain System.out.println() ?
-Ans: The System class contains several useful class fields and methods. It cant be instantiated
It is "public final class System extends Object"
In general 'Out' is the object of PrintStream class (It is static)
'println' is the method with void as return