Friday, 17 May 2013

JAVA Create class And call it's method

class abc{
           public void prints(){
                   System.out.println("prints method is called");
           }
}
class file_name{

           public static void main(String ar[]){
                     abc s=new abc();

                      System.out.println("s is instance of the abc class");
                      s.prints();
           }
}


OutPut
----------------------
s is instance of the abc class
prints methos is called

No comments:

Post a Comment