Академический Документы
Профессиональный Документы
Культура Документы
1
Objectives of This Session
2
Refer Core Java
Chapter 1
History of Java
3
Features of java
Features of Java
Object Oriented Architecture neutral
Simple Portable
Robust Interpreted
Distributed Dynamic
Secure Multi threaded
4
Simple
5
Distributed
Distributed System
Extensive library of routines for coping with TCP/IP
protocols like HTTP & FTP
Applications can access objects across the net with ease
E.g.
Creating socket connections,Servlets & CGI scripting
RMI enables communication between different objects
6
Robust
Reliable
Early checking for potential problems.
Dynamic checking to eliminate error-prone situations.
Developer doesnt have to worry about
Bad pointers
Memory allocation errors.
Memory leakage.
7
Secure
Security Manager
8
Architecture Neutral
9
Windows
.c file
Source
Compile Mac
Code
Compile
UNIX
10
Windows
.Java file .class file
UNIX
11
Portable
12
Multi Threaded
13
Interpreted
14
Structures in C
Structure in C
Supports only data abstraction
Only function pointer can be data member
15
Structures in C
Structure in C
struct directory
{
char Name[30];
long PhoneNo;
};
16
Class
17
Class
18
Class Syntax
class class-name
{
variable declaration ;
method declaration ;
public static void main(String args[ ])
{
..
}
} // end of class
20
Class greeting
/* a comment */
// another comment
class greeting
{
public static void main(String args[ ]){
System.out.println(Hello world);
} // end of main
} //end of class
21
A sample class
class Date {
int dd, mm, yy;
public void initDate(){
dd = mm = yy = 0;
}
public void setDate(int d, int m, int y){
dd = d;
mm = m;
yy = y;
}
public void dispDate(){
System.out.println(Date is : + dd +-+ mm +-+ yy);
}
22
A sample class
d1.setDate(3,7,90);
d1.dispDate();
}
}
23
Access specifiers
24
Accessor & mutator methods
class Demo{
String name;
25
Accessor and Mutator methods
26
A Typical Java Environment
class Loader
Native OS
27
Class Loader
28
Bytecode Verifier
29
JVM
30
primitive data types
31
Primitive DateTypes
32
Summary of Primitive Datatypes
33
Summary of Primitive Data Types
Width
Data Types Default Value Wrapper Class
(bits)
boolean false 1 Boolean
byte 0 8 Byte
short 0 16 Short
char \u0000 16 Character
int 0 32 Integer
long 0 64 Long
float +0.0F 32 Float
double +0.0D 64 Double
34