Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Java Basics
Incheon Paik
? Java
? James Gosling, Arthur Van Hoff, Andy Bechtolsheim
Binary
File
Compiler(Pentium) Pentium
Source Binary
Code File
Compiler(PowerPC) PowerPC
Binary
%cc Hello.c –o Hello File
% Hello Compiler(SPARC) SPARC
Java
Interpreter
Java Compiler
(Pentium) Pentium
Java Java
Java
Code ByteCode
Interpreter
(Independent on
Java Compiler Platform)
PowerPC
(PowerPC)
Java
%javac Hello.java Interpreter
Hello.class created
language
? Applet
? Program running in Web Browser Environment
with JVM
? Instance of Class
? Class
? Template of Creating Object
? Inheritance
? Inherit the data and methods of parent class
? Polymorphism
Shape getArea()
Shape Obj = new Ellipse();
Obj.getArea();
Running Environment
Running Environment
Run
% java Hello % hello
Value assign
varName = value;
? += -= *= /= %=
? ++ --
? j += 6; ? j = j + 6;
double float
Yes No
float long
Yes No
long int
Type Casting
*/
type VarName[]
int ia[];
varName.length
Example 1.15
type VarName[][];
float fa[][];
varName[index].length
Example 1.16
? 47 Java Keywords
abstract double int super
boolean else interface switch
break extends long synchronized
byte final native this
case finally new throw
catch float package throws
char for private transient*
class goto* protected try
const* if public void
continue implements return volatile
default import short while
do instanceof static
? Step 4 (Array)
? Refer this lecture slide #22