A class is templates or Blue Print from which
individual objects are created. Everything (like
variables, methods) in java resides in java class. Class describes the behavior
and state that object of its type support. A sample of a class is given below:
1: public class Human {
2: String name;
3: int age;
4: String color;
5: void sleeping( ){
6: statement Block;
7: }
8: void eating( ){
9: statement Block;
10: }
11: void reading( ){
12: statement Block;
13: }
14: }
0 comments:
Post a Comment