Source code: import java.util.*; class Student {public void display(int ID, String name, int year, String department) { System.out.println("ID of student is: " + ID); System.out.println("Name of student is: " + name); System.out.println("Year : " + year); System.out.println("Department: " + department);
} }
public class Student1{ public static void main(String[] args) { Student student1 = new Student() student1.display(21005036, "Karan Dev", 2023, "Computer science");
} }
Output: I
0 Comments