JAVA 2.1 to call the method print() of class Student

class Student {
public void print() {
System.out.println("Hi! I am class STUDENT.");
    }
}

public class Question{
public static void main(String args[]){
Student s=new Student();
s.print();
}
}

No comments:

Post a Comment