Classes - Static and Instance
Quiz
•
Computers
•
10th - 12th Grade
•
Hard
Jesse Victoroff
Used 1+ times
FREE Resource
Enhance your content in a minute
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Math.random() is an example of a static method
True
False
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is true about this code running in a client program?
This code will not compile no matter what
This code will compile no matter what
This code will only compile if printIdNum is an instance method
This code will only compile if printIdNum is a static method
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between "static" and "instance"?
Static items belong to the object, instance items belong to the class
Static items belong to the class, instance items belong to the object
Static refers to variables, instance refers to methods
Static refers to methods, instance refers to variables
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is TRUE about instance variables
They can be accessed from within a class without an accessor method
They can be accessed from outside a class without an accessor method
You must both declare and instantiate them before your constructor
They must be public
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is NOT true about default constructors
Java will create a default Constructor if you forget to write one
A default constructor cannot use negative numbers
A default constructor cannot have parameters
A default constructor cannot have a return type
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the "new" keyword do?
Create a new spot in memory for a class data type
Create a new spot in memory for a primitive data type
Declare a new variable
Initialize a new variable
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does a constructor do?
Create a new spot in memory for a class data type
Declare instance variables
Initialize the values of the instance variables
Create a new class
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
0 questions
Java Writing Classes Unit 5 Quiz
Quiz
•
0 questions
AP CS A Vocab Review
Quiz
•
0 questions
AP CS Final Exam
Quiz
•
0 questions
CompSci A Unit 5: Classes and Objects
Quiz
•
0 questions
Java Class Definitions
Quiz
•
0 questions
Java Classes and Object-Oriented Programming Quiz
Quiz
•
0 questions
Java Review 1
Quiz
•
0 questions
Understanding Java Instance Variables
Quiz
•
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
