What is the result?

View the exhibit:
public class Student {
public String name = "";
public int age = 0;
public String major = "Undeclared";
public boolean fulltime = true;
public void display() {
System.out.println("Name: " + name + " Major: " + major); }
public boolean isFullTime() {
return fulltime;
}
}
Given:
Public class TestStudent {
public static void main(String[] args) {
Student bob = new Student (); bob.name = "Bob"; bob.age = 18; bob.year = 1982;
}
}
What is the result?
A. year is set to 1982.
B. bob.year is set to 1982
C. A runtime error is generated.
D. A compile time error is generated.

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.