Search Header Logo

#119 Topic 2.3 Video 2

Authored by Myra Deister

Computers

11th Grade

Used 1+ times

#119 Topic 2.3 Video 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the video the first attribute that is created for a lamp is

color

size

isOn

location

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is one of the behaviors for the lamp in the video?

setBrightness

turnOn

setLevel

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a NullPointerException?

A NullPointerException is a runtime error that occurs when a program tries to access or use an object reference that has a null value.
A NullPointerException is a compile-time error that occurs when a program tries to access or use an object reference that has a null value.
A NullPointerException is a syntax error that occurs when a program tries to access or use an object reference that has a null value.
A NullPointerException is a logical error that occurs when a program tries to access or use an object reference that has a null value.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output by the code below?      

 

public class CS

{

   public void one()

   {   

     System.out.print("go")

}

 

   public void two()

   {    

     System.out.print("back");

   }

}

//code in the main of another class

CS test = new CS();

test.one();

test.two();

go

back

goback

gobackback

gobackgobackgo

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correctly written method for the class below?

public class Timer

{

private int startMin;

private int length;


public Timer(int minute, int duration)

{

startMin = minute;

length = duration;

}


public Timer(int duration)

{

startMin = 0;

length = duration;

}

}

public void addFiveMinutes()

{

length = length + 5;

}

public addFiveMinutes()

{

length = length + 5;

}

addFiveMinutes()

{

length = length + 5;

}

public void addFiveMinutes

{

length = length + 5;

}

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?