Tuesday 28 June 2016

Classes in Java

Classes in Java:

A class is a blue print from which individual objects are created.
A sample of a class is given below:
public class Dog{
   String breed;
   int ageC
   String color;

   void barking(){
   }
   
   void hungry(){
   }
   
   void sleeping(){
   }
}
A class can contain any of the following variable types.
1. Variable
2.constructor
3.Object
4.Method
5.


 

 
 

No comments:

Post a Comment