Search Header Logo

Java Basic Object Interaction

Authored by Brian Ciavarella

Computers

9th - 12th Grade

Used 13+ times

Java Basic Object Interaction
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

28 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT true about a constructor?

The constructor usually has the same name as the class, but it can be something else.

The constructor sets the values of the fields.

The constructor does not contain a return type in the heading.

The constructor may have parameters, but does not have to.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

If a class named Taco is defined with a no-args constructor, then which of the following is the proper way to create a Taco object.

Taco myTaco = new Taco();

new Taco() = Taco myTaco;

Taco new Taco() = myTaco;

myTaco() = new Taco();

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is the correct way to write a no-args constructor of the class Car

public Car()

public void Car()

private Car()

public Car

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an accessor method?

public void getName()

public void setName()

public String getName()

public String setName()

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is Not a return type?

String

void

int

private

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

An object is an instance of a:

parameter
method
class
application

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

As a blueprint is a design for a house, a class is a design for a:

object
variable
constant
statement

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?