Question: Suppose we have a Java class called Student.java Student (id, name, phone, level) 9 public class Student 8 private String id; private String name;

Suppose we have a Java class called Student.java Student (id, name, phone,

Suppose we have a Java class called Student.java Student (id, name, phone, level) 9 public class Student 8 private String id; private String name; private String phone; private int level; public Student (String id, String name, String phone, int level) { } this.id id; this.name = name; this.phone-phone; this.level level; public String getId () {return id;} public int getPhone () {return phone; } public String getName() {return name; } public int getLevel () {return level;} 6.1 In the following main method which lines contain reflection calls? import java.lang.reflect.Field; 1. public class TestStudent 2. { public static void main(String args[]) throws Exception. { 3. 4. 5. 6. 7. 8. 9. } 10. Student student new Student ("12345", "Peter", "0422386948", 4); Field field student.getClass().getDeclaredField("phone"); field.setAccessible (true); field.set (student, "0422198032"); [3 marks] 6.2 What reflection code would you add to find the methods that the Student class has WITHOUT instantiating Student. 17 markel

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!