java

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

java

Post by answerhappygod »

java
Java 1
Java 1 (19.38 KiB) Viewed 69 times
Java 2
Java 2 (11.12 KiB) Viewed 69 times
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) ...}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply