Basic Java Flashcards

1
Q

determination of the main program

A

public static void main(String[] args){

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

end of line comments

A

//

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

comment field

A

/* comment */

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

2 numbers each side of the decimal

A

double

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

string type

A

String

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

+ + variable;

- variable;

A
variable = variable + 1;
variable = variable - 1;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

printing operation

A

System.out.println();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

to print a quotation mark

A

"

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A Java keyword used in a class definition to specify that a class is not to be instantiated, but rather inherited by other classes.

A

abstract

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A Java keyword used to resume program execution at the statement immediately following the current statement. If followed by a label, the program resumes execution at the labeled statement.

A

break

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A Java keyword that defines a group of statements to begin executing if a value specified matches the value defined by a preceding switch keyword.

A

case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A Java keyword used to declare a block of statements to be executed in the event that a Java exception, or run time error, occurs in a preceding try block.

A

catch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A Java keyword used to declare a a single 16-bit Unicode character variable.

A

char

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A Java keyword used to resume program execution at the end of the current loop. If followed by a label, it resumes execution where the label occurs.

A

continue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A Java keyword optionally used after all case conditions in a switch statement. If all case conditions are not matched by the value of the switch variable, this keyword will be executed.

A

default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A Java keyword used to declare a loop that will iterate a block of statements. The loop’s exit condition can be specified with the while keyword.

A

do

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

A Java keyword used to define a a double-precision 64-bit IEEE 754 floating point variable.

A

double

For decimal values, this data type is generally the default choice.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

A Java keyword used to execute a block of statements in the case that the test condition with the if keyword evaluates to false.

A

else

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A Java keyword used to declare an enumerated type, whose legal values consist of a fixed set of constants.

A

enum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

A Java keyword used to define an entity once and cannot change it or derive from it later.

A

final

A class with this keyword cannot be subclassed, a method with this keyword cannot be overridden and a variable with this keyword cannot change from its initialized value.

21
Q

A Java keyword that executes a block of statements regardless of whether a Java Exception, or run time error, occurred in a block defined previously by the try keyword.

A

finally

22
Q

A Java keyword used to define a a single-precision 32-bit IEEE 754 floating point number variable.

A

float

23
Q

A Java keyword used to declare a loop that reiterates statements. The programmer can specify the statements to be executed, exit conditions, and initialization variables for the loop.

A

for

24
Q

A Java keyword used to conduct a conditional test and execute a block of statements if the test evaluates to true.

A

if

25
Q

A Java keyword included in the class declaration to specify any interfaces that are used by the current class.

A

implements

26
Q

A Java keyword used at the beginning of a source file that can specify classes or entire packages to be referred to later without including their package names in the reference.

A

import

27
Q

A Java keyword used to define a 32-bit signed two’s complement integer variable.

A

int

For integral values, this data type is generally the default choice unless there is a reason to choose something else.

28
Q

A Java keyword used to define a collection of method definitions and constant values. It can be implemented by other classes with the “implements” keyword.

A

interface

29
Q

A Java keyword used to define a 64-bit signed two’s complement integer variable.

A

long

30
Q

A Java keyword that is used in method declarations to specify that the method is not implemented in the same Java source file, but rather in another programming language.

A

native

31
Q

A Java keyword used to create an instance of a class.

A

new

32
Q

A Java keyword used in a method or variable declaration. It signifies that the method or variable can only be accessed by other elements of its class

A

private

33
Q

A Java keyword used in a method or variable declaration. It signifies that the method or variable can only be accessed by elements residing in its class, subclasses, or classes in the same package.

A

protected

34
Q

A Java keyword used in a method or variable declaration. It signifies that the method or variable can be accessed by elements residing in other classes.

A

public

35
Q

A Java keyword that causes the code to exit from the current method, and the control flow returns to where the method was invoked.

A

return

It has two forms: one that returns a value, and one that doesn’t.

36
Q

A Java keyword used to define a 16-bit signed two’s complement integer variable.

A

short

37
Q

A Java keyword used to define a variable as a class variable. Classes maintain one copy of class variables regardless of how many instances exist of that class.

A

static

This keyword can also be used to define a method as a class method. Class methods are invoked by the class instead of a specific instance, and can only operate on class variables.

38
Q

A Java keyword used to access members of a class inherited by the class in which it appears.

A

super

39
Q

A Java keyword used to evaluate a variable that can later be matched with a value specified by the case keyword in order to execute a group of statements.

A

switch

40
Q

A keyword in the Java programming language that, when applied to a method or code block, guarantees that at most one thread at a time executes that code.

A

synchronized

41
Q

A Java keyword that can be used to represent an instance of the class in which it appears. It can be used to access class variables and methods.

A

this

42
Q

A Java keyword that enables the programmer to _____ an exception at that point in the code. The exception will be caught by the nearest try-catch clause that can catch that type of exception.

A

throw

43
Q

A Java keyword used in method declarations that specify which exceptions are not handled within the method but rather passed to the next higher level of the program.

A

throws

44
Q

A keyword in the Java programming language that indicates that a field is not part of the serialized form of an object.

A

transient

45
Q

A Java keyword that defines a block of statements that may throw a Java language exception. If an exception is thrown, an optional catch block can handle specific exceptions thrown within that block. Also, an optional finally block will be executed regardless of whether an exception is thrown or not.

A

try

46
Q

A Java keyword used in method declarations to specify that the method does not return any value. It can also be used as a nonfunctional statement.

A

void

47
Q

A Java keyword used in variable declarations that specifies that the variable is modified asynchronously by concurrently running threads.

A

volatile

48
Q

A Java keyword used to declare a loop that iterates a block of statements. The loop’s exit condition is specified as part of this statement.

A

while