sabato 30 marzo 2013

Q96


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();

 
Risposta C

Nessun commento:

Posta un commento