Unit 2

Unit 2

9th - 12th Grade

44 Qs

quiz-placeholder

Similar activities

02. Role SCRUM

02. Role SCRUM

1st Grade - University

45 Qs

Front office

Front office

12th Grade

40 Qs

MID Sem 5 PWPB XIIRPL

MID Sem 5 PWPB XIIRPL

2nd Grade - University

40 Qs

SafeStaff AI- Food Safety #3

SafeStaff AI- Food Safety #3

9th - 11th Grade

46 Qs

AMTBLK06 Final A

AMTBLK06 Final A

12th Grade - University

45 Qs

Entrepreneurship Pretest

Entrepreneurship Pretest

9th - 12th Grade

45 Qs

Veterinary Terminology

Veterinary Terminology

11th - 12th Grade

46 Qs

Graphic Design Concept Check

Graphic Design Concept Check

9th - 12th Grade

42 Qs

Unit 2

Unit 2

Assessment

Quiz

Professional Development

9th - 12th Grade

Hard

Created by

Termell Middlebrooks

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

44 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an object in Java?

An object is a template for how to make new programs in Java.

An object is something that contains both state and behavior.

An object is a single part of a computer program.

An object is a list of variables.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the relationship between a class and an object?

A class definition specifies the attributes and behavior of every object that will be made.

An object definition specifies the attributes and behavior of every class that will be made.

A class specifies the attributes and behaviors for exactly one object.

Every object can choose which attributes and behavior it wants to keep from the class definition.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Every class definition has each of the following EXCEPT

A name

Defined attributes

Defined behaviors to manipulate the state of the objects

Defined objects as copies of the class

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public class Pineapple

{

private boolean isRipe;

private String color;

private double weight;


// Rest of class goes here

}

Every Pineapple object will be yellow

Every Pineapple object must choose which attributes it wants.

Every Pineapple object will have the same attributes.

It is impossible to know what attributes the Pineapple objects will have since the attributes are not listed here.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a constructor in Java?

A constructor is something that holds the private state of an instance.

A constructor allows us to create a new instance of a class, usually initializing instance variables.

A constructor is a method with instructions on how to use a class.

A constructor is a syntax rule in Java for placing curly brackets.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public class Card

{

private String suit;

private int value; //13 values for each suit in deck (0 to 12)


public Card (String cardSuit, int cardValue)

{

/* implementation */

}


// Rest of the class goes here

}

cardSuit = suit;

cardValue = value;

Card = new Card (cardSuit, cardValue);

suit = cardSuit;

value = cardValue;

suit = "Hearts";

value = 3;

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

/**

* The Shark class describes a shark.

*

* Every shark has a region where it lives and an age.

*

*/


public class Shark

{

// Attributes

private String habitat;

private int age;


public Shark(String region, int sharkAge)

{

habitat = region;

age = sharkAge;

}

}

habitat

String

Shark

sharkAge

Create a free account and access millions of resources

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?

Discover more resources for Professional Development