stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Java Programming Basics Flashcards | StudBud
Explore
/
Java Programming Basics
Java Programming Basics
15 terms
·
StudBud Administration
·
9 plays
Test your knowledge on fundamental concepts and syntax of Java programming
Flashcards
15 cards
F
Practice quiz
P
Host live
L
Questions
15
Answers
1
Main purpose of getter and setter?
Create objects
Access private vars
Inherit methods
Override methods
2
Keyword to access private data?
private
this
static
final
3
Which loop runs at least once?
while
for
do-while
foreach
4
What is method overloading?
Method inside another
Same name, diff params
Static methods
Override in subclass
5
Return type of a constructor?
None
class type
void
No return type
6
Correct way to declare Java array?
int arr[]
int arr()
array arr
arr[5]
7
Keyword for constant variable in Java?
final
static
constant
const
8
True or false: Java methods must be static
False
True
9
Define a constructor in Java?
Same as class
'new' keyword
'constructor' keyword
'construct()' method
10
Call a method in Java?
methodName();
methodName;
call methodName();
methodName[];
11
How to access array element?
arr
arr(0)
arr[0]
arr{0}
12
Purpose of a constructor in Java?
Destroy object
Create class
Initialize object
None
13
Use of 'this' keyword in Java?
New object
Declare method
Current instance
Superclass method
14
Size of int variable in Java?
Depends on system
8 bytes
2 bytes
4 bytes
15
True or false: Java arrays can be resized
True
False