JAVA PROGRAMMING EXAM
QUESTIONS WITH 100%
VERIFIED ANSWERS
While - Answer- a period of time marked by a condition, i.e. Stay here while I go see the
doctor.
Return - Answer- a statement which gives the output of the specific task. This will be
used when you implement the conditional statement.
Public - Answer- accessible or shared by all members, i.e. I went into the public
restroom.
Static - Answer- not moving, i.e. The static content on the screen did not move.
single line comment - Answer- //......
multi line comment - Answer- /**....**/
boolean - Answer- a one-bit value (one digit) represented true or false, 1 or 0
float - Answer- a 4-byte value that represents values from 1.40129846432481707 x 10-
45 to 3.4028234
identifier - Answer- must start with a letter. It can be followed by a combination of
numbers and two allowed special characters: underscore '_' and dollar sign '$'. When
naming identifiers you need to be careful not to use any Java keywords.
assignment operator - Answer- As its name, an assignment operator assigns a value to
a variable. An assignment operator is represented by an equal sign. (X=5) With an
assignment operator, Java runs the program from the right side to the left side. All other
operators are evaluated from left to right.
arithmetic operators - Answer- Addition +
Subtraction -
Multiplication *
Division /
Modulo Division %
relational operators - Answer- Greater Than >
Less Than <
, Greater Than or Equal To >=
Less Than or Equal To <=
Equal To ==
Not Equal To !=
logical operators - Answer- These operators are used to evaluate two expressions. The
evaluation stops as soon as the result is known.
&& AND
|| OR
! NOT
&& operator - Answer- This logical operator represents the logical operation AND in
Java. This expression shows the result true if both its operands have the same value
and false if not.
X Y X&&Y
111
100
010
000
Note: 1 represents true, 0 represents false
|| operator - Answer- This operator represents the logical operation OR in Java. This
expression shows the result false only if both its operands have the same value, and
true even if one value is satisfied.
X Y X||Y
111
101
011
000
Note: 1 represents true, 0 represents false
! operator - Answer- ! represents the logical operation NOT. In this type of operator the
result is the opposite of the first operand.
X Y X!
110
100
011
001
Note: 1 represents true, 0 represents false
In this operation, if X is true then the resulting value will be false.
This logical operator is used primarily to construct multiple conditional statements.
bitwise operators - Answer- Anything and everything in the computer's memory is stored
as a bit represented by 1s and 0s. So, the machine language of a computer is 1 and 0.
It's that simple. Programmers use bitwise operators to manipulate these bits.
& Exclusive AND
QUESTIONS WITH 100%
VERIFIED ANSWERS
While - Answer- a period of time marked by a condition, i.e. Stay here while I go see the
doctor.
Return - Answer- a statement which gives the output of the specific task. This will be
used when you implement the conditional statement.
Public - Answer- accessible or shared by all members, i.e. I went into the public
restroom.
Static - Answer- not moving, i.e. The static content on the screen did not move.
single line comment - Answer- //......
multi line comment - Answer- /**....**/
boolean - Answer- a one-bit value (one digit) represented true or false, 1 or 0
float - Answer- a 4-byte value that represents values from 1.40129846432481707 x 10-
45 to 3.4028234
identifier - Answer- must start with a letter. It can be followed by a combination of
numbers and two allowed special characters: underscore '_' and dollar sign '$'. When
naming identifiers you need to be careful not to use any Java keywords.
assignment operator - Answer- As its name, an assignment operator assigns a value to
a variable. An assignment operator is represented by an equal sign. (X=5) With an
assignment operator, Java runs the program from the right side to the left side. All other
operators are evaluated from left to right.
arithmetic operators - Answer- Addition +
Subtraction -
Multiplication *
Division /
Modulo Division %
relational operators - Answer- Greater Than >
Less Than <
, Greater Than or Equal To >=
Less Than or Equal To <=
Equal To ==
Not Equal To !=
logical operators - Answer- These operators are used to evaluate two expressions. The
evaluation stops as soon as the result is known.
&& AND
|| OR
! NOT
&& operator - Answer- This logical operator represents the logical operation AND in
Java. This expression shows the result true if both its operands have the same value
and false if not.
X Y X&&Y
111
100
010
000
Note: 1 represents true, 0 represents false
|| operator - Answer- This operator represents the logical operation OR in Java. This
expression shows the result false only if both its operands have the same value, and
true even if one value is satisfied.
X Y X||Y
111
101
011
000
Note: 1 represents true, 0 represents false
! operator - Answer- ! represents the logical operation NOT. In this type of operator the
result is the opposite of the first operand.
X Y X!
110
100
011
001
Note: 1 represents true, 0 represents false
In this operation, if X is true then the resulting value will be false.
This logical operator is used primarily to construct multiple conditional statements.
bitwise operators - Answer- Anything and everything in the computer's memory is stored
as a bit represented by 1s and 0s. So, the machine language of a computer is 1 and 0.
It's that simple. Programmers use bitwise operators to manipulate these bits.
& Exclusive AND