// This is the class named Student
class Student {
// This is a method in class Student
public void print() {
System.out.println("Hi! I am class STUDENT.");
}
}
public class Question21
{
public static void main(String args[])
{
// Create an object of class Student
Student s1=new Student();
// Call 'print()' method of class Student
s1.print();
class Student {
// This is a method in class Student
public void print() {
System.out.println("Hi! I am class STUDENT.");
}
}
public class Question21
{
public static void main(String args[])
{
// Create an object of class Student
Student s1=new Student();
// Call 'print()' method of class Student
s1.print();
}
}
0 Comments