Which line of code initializes a student instance?

View the exhibit:
<code>
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;
}
</code>
Which line of code initializes a student instance?

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;
}

Which line of code initializes a student instance?

A.
Student student1;

B.
Student student1 = Student.new();

C.
Student student1 = new Student();

D.
Student student1 = Student();



Leave a Reply 0

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