Nlp-Ai Java Lecture No. 9
Nlp-Ai Java Lecture No. 9
Satish Dethe
<[email protected]>
08 Oct 2004
Contents
08 Oct 2004
[email protected]
Object & Class
Examples :
Class : Object :
Man Abdul Kalam
Fruit Banana
Language Java, Marathi
Car Maruti 800, Santro
Fort Lohgadh, Raigadh
Software Lab CFILT, TCS, CFDVS
Shooter Major Rajvardhan Singh Rathore
08 Oct 2004
[email protected]
Object & Class ….
08 Oct 2004
Class & Objects …
Class :
Attributes:
Hair, eyes, face, Neck,
torso, hands, legs.
Fingers, height, weight,
age.
Methods:
walk(), talk(), point(),
Laugh(), cry(), dance(),
steady()
[Definition of Class Man]
man.java
08 Oct 2004
Object & Class …
08 Oct 2004
[email protected]
Method
• Need for Method
• General Syntax
<return type><method name>(<parameter list>)
{ //method body
<statement(s)>
}
NOTE: Methods are always declared inside class.
Return type is void if not returning anything, else concern data-
type.
Modify man.java
08 Oct 2004
[email protected]
Method Examples
void hello(String guest){
//not returning anything
System.out.println(“Oh! Hello ” + guest);
}
int ReturnSquare (int a_number){
//returning data of type int
int square = a_number * a_number;
return square;
}
Refer : sayHello.java
08 Oct 2004
[email protected]
String Class
08 Oct 2004
[email protected]
String Class…
Thank You!
08 Oct 2004
[email protected]