Unit 2
Quiz
•
Professional Development
•
9th - 12th Grade
•
Hard
Termell Middlebrooks
Used 4+ times
FREE Resource
Enhance your content in a minute
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
40 questions
Resume, CV and Cover Letter Quiz
Quiz
•
2nd Grade - University
47 questions
Plumbing Materials Quiz
Quiz
•
11th Grade
45 questions
Part 107 Regulations Practice
Quiz
•
9th - 12th Grade
47 questions
Quiz on States and Schools
Quiz
•
8th Grade - University
40 questions
1st February 2025 Revision Test @ Indefatigables 25, DBSSS, DDMA
Quiz
•
10th Grade
40 questions
Evolution and fundamentals of business
Quiz
•
11th Grade
47 questions
Novice Par Law
Quiz
•
9th Grade
40 questions
Front Office XI
Quiz
•
11th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
