Java Interview Questions

Q46. The operator sign ‘|’ is used for Bitwise ______
(a) AND
(b) OR
(c) XOR
(d) Complement

Q47. Which of the following operator has higher precedence
(a) +
(b) -
(c) *
(d) ||

Q48. When a=9, b=12, c=3 then output of following statement is: x = a-b/3+c*2-1
(a) 8
(b) 10
(c) 12
(d) 15

Q49. Unary minus ‘-‘ has associativity from
(a) Right to left
(b) Left to right
(c) Not associative
(d) None of the above

Q50. Which one returns the smallest whole number greater than or equal to x is
(a) rint(x)
(b) sqrt(x)
(c) log(x)
(d) ceil(x)

Q51. What is the action of rint() in Java
(a) Returns the absolute value of the argument
(b) Returns the smallest of the two arguments
(c) Returns the double value that is closest in value to the argument
(d) Returns the largest integer that is less than or equal to the argument

Q52. Which one will returns the absolute value of a
(a) rint(a)
(b) log(a)
(c) abs(a)
(d) exp(a)

Q53. One if or else if statement inside another if or else if statement is
(a) if statement
(b) if-else statement
(c) if-else-if ladder
(d) nested if statement

Q54. Built-in multiway decision statement in Java is known as
(a) Switch
(b) Oprator
(c) Break
(d) Continue

Q55. Case and break are used in ___
(a) Jump
(b) if-else
(c) nested-if
(d) Switch

Q56. Which one jump statement is not supported in Java
(a) Else
(b) Break
(c) Return
(d) Continue

Q57. ____ leaves a loop, ____ jumps to the next iteration
(a) break,continue
(b) continue,break
(c) switch,break
(d) break,switch

Q58. In Java, the functions are called
(a) Fields
(b) Methods
(c) Operator
(d) Class

Q59. Header should always be declared independently separated by
(a) Dot
(b) Slash
(c) Commas
(d) Pipe

Q60. Which one enables an object to initialize itself when it is created
(a) Validator
(b) Arguments
(c) Parameters
(d) Constructor

1 2 3 4 5 6 7 8