stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Java Flashcards | StudBud
Explore
/
Java
Java
20 terms
·
StudBud Administration
·
25 plays
Imported from external platform
Flashcards
20 cards
F
Practice quiz
P
Host live
L
Questions
20
Answers
1
Which of the following is the syntax of a ternary operator?
condition ? doIfTrue : doIfFalse
for (Type entry : list) {...}
while (condition) { ... }
if (condition) {...} else {...}
2
Primitive data types can be null
False
True
3
Which of the following methods will get the number of elements in an ArrayList?
length
length()
size()
count()
4
A class can implement multiple interfaces
False
True
5
What is the very first method called, and must exist, in a Java executable program?
begin()
main()
start()
compile()
6
Non-default methods in an interface have a method body
False
True
7
I can add "$123" to the follow: ArrayList<Double> receiptTotals
True
False
8
What is encapsulation?
Hiding fields of an object from other code that uses the object
A class within a class
Surrounding a variable with parentheses in either a method or calculation
Giving a variable a starting value but expecting it to change later
9
Which of the following is an enhanced / for each loop?
for (int x = 1; x < 10; x++) {...}
for (Type entry : list) {...}
for (Type : list ) {...}
foreach(entry : list) {...}
10
arrays are base 1
False
True
11
What is inheritence?
When you use a non-primitive data type
When you create a class based on another class
When you call a method from another class.
When you create a class from a pre-defined structure
12
What is polymorphism?
When you change the value of a variable
When you can treat an object of a subclass as a superclass
When you inherit multiple classes
When you use an interface
13
Which of the following methods will get the number characters in a String?
length()
size()
count()
length
14
Fill in the blanks: HashMap<___,___>
rowCount, columnCount
hashType, mapType
keyType, valueType
inputType, returnType
15
Integer x = null; is a valid statement
True
False
16
What are some concepts in Object Oriented Programming?
JDBC
Methods
Inheritence
Compilation
Polymorphism
Encapsulation
17
Which of the following methods will get the number of elements in an array?
count()
length()
length
size()
18
In this array {1, 2, 3, 4, 5} what number is at position 4?
4
3
2
5
19
What is a generic?
A collection of values that never change
A feature that lets you make typed collections
A loop that always runs at least once
A variable that can hold any data type
20
A subclass can inherit from multiple superclasses.
True
False