Question: Task 2: PC3.6 Refer to the Subject class that you have completed in the previous task, given the following Tester class: public class Tester public

 Task 2: PC3.6 Refer to the Subject class that you have

Task 2: PC3.6 Refer to the Subject class that you have completed in the previous task, given the following Tester class: public class Tester public static void main(String[] args) { subject S1 = new subject(); subject.change(35); System.out.println(Subject.test); System.out.println( subject test2); } } Discuss why the code segment will not compile. List and Identify how many local variables are there in the below class class subject private String sub; private int marks; private double average; public subject sub = "Physics"; marks = 60; average = 79.5; int x = 20; double y = 30; } public void change(String a) int z = 10; sub = a; } public String displayo: int w = 5; return sub; }

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 Databases Questions!