Question: What is the output of the following Java program? public class Exam { static int studyingHours = 3 1 ; private String course = OOP

What is the output of the following Java program?
public class Exam
{
static int studyingHours =31;
private String course =OOP;
public void compute(int studyingHours)
{
Exam e = new Exam();
this.studyingHours =24;
course =Math;
System.out.println("Exam.studyingHours: "+ Exam.studyingHours);
System.out.println("e.studyingHours: "+ e.studyingHours);
System.out.println("e.course: "+ e.course);
System.out.println("course: "+ course);
}
public static void main(String args[])
{
Exam e = new Exam();
e.compute(31);
}
}

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!