Given:

public class Main {
	class Student {  //line 1
 		String classname;
 		public Student(String classname) { //line 2
  			this.classname = classname;
 		}
	}
	public static void main(String[] args) {
 		var student = new Student("Biology"); //line 3
	}
}

Which two independent changes will make the Main class compile? (Chosoe two)

Change line 1 to static class Student {

Move the entire Student class declaration to a separate Java file, Student.java

Change line 1 to public class Student {

Change line 2 to public Student(String classname)

Correct Option - ab

To get all Infosys Certified Java SE11 Developer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in