Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started