java
Posted: Sun May 15, 2022 1:00 pm
java
1. class Student{ 2. int rollno; 3. String name; 4. static String college ="MIT"; 5. 6. Student(int r, String n) 7. rollno = r; 8. name = n; 9. } 10. void display ({System.out.println(rollno+" "+name+""+college);} 11. 12. public static void main(String args[]X 13. Student s1 = new Student (1001,"Karan Smith"); 14. 15. s1 display(); 16. } 17. } O A. 1001 Karan Smith MIT O B. 1001 Karan Smith O C. 1001+""+Karan Smith+""+MIT OD. 1001+" "+Karan Smith+""
QUESTION 20 Which is the correct main method? O A. static public void main(String[] args) {---} O B. public void main(String[] args) {...} O C. public static void main(String args---} O D.public static int main(String args) ...}
1. class Student{ 2. int rollno; 3. String name; 4. static String college ="MIT"; 5. 6. Student(int r, String n) 7. rollno = r; 8. name = n; 9. } 10. void display ({System.out.println(rollno+" "+name+""+college);} 11. 12. public static void main(String args[]X 13. Student s1 = new Student (1001,"Karan Smith"); 14. 15. s1 display(); 16. } 17. } O A. 1001 Karan Smith MIT O B. 1001 Karan Smith O C. 1001+""+Karan Smith+""+MIT OD. 1001+" "+Karan Smith+""
QUESTION 20 Which is the correct main method? O A. static public void main(String[] args) {---} O B. public void main(String[] args) {...} O C. public static void main(String args---} O D.public static int main(String args) ...}