Java ProgrammingPrograming & IT Mcqs 100+ MCQ & Answer Java programming | page-06 |Computer Engineering MCQ And Answer January 27, 2025 DSN MARATHI 51. A boolean literal in Java can be type casted to which data type? A. byte B. short C. int D. None of the above Answer Option : 4 52. If a variable or operand in an expression is type long, then all the operands are type promoted to which data type? A. int B. long C. float D. double Answer Option : B 53. An Arithmetic expression in Java involves which Operators or Operations? A. Addition (+), Subtraction (-) B. Multiplication (*), Division (/) C. Modulo Division (%), Increment/Decrement (++/–), Unary Minus (-), Unary Plus (+) D. All the above Answer Option : D 54. Choose the Compound Assignment Arithmetic Operators in Java below. A. +=, -= B. *=, /= C. %= D. All the above Answer Option : D 55. Which is the arithmetic operator in Java that gives the Remainder of Division? A. / B. @ C. % D. & Answer Option : C 56. Arithmetic operators +, -, /, * and % have which Associativity? A. Right to Left B. Left to Right C. Right to Right D. Left to Left Answer Option : B 57. Among Postfix Decrement and Prefix Increment operators in Java, which operator has less priority? A. Postfix Decrement has less priority than Prefix Increment B. Prefix Increment has less priority than Postfix Decrement C. Both operators have same priority D. None of the above Answer Option : B 58. Increment and Decrement arithmetic operators in Java has which Associativity? A. Left to Right B. Right to Left C. Left to Left D. Right to Right Answer Option : B 59. Choose the correct statement about Java Operators +, -, *, / and %. A. + and – have equal priority B. * and / have equal priority C. / and % have equal priority D. All the above Answer Option : D 60. Choose the correct statement about Java Prefix and Postfix operations. A. Prefix operation is carried out immediately and the variable value will be incremented or decremented accordingly B. Postfix operation is carried out on the next line or statement. So the variable value will not change. C. A and B D. None of the above Answer Option : C
51. A boolean literal in Java can be type casted to which data type? A. byte B. short C. int D. None of the above Answer Option : 4
52. If a variable or operand in an expression is type long, then all the operands are type promoted to which data type? A. int B. long C. float D. double Answer Option : B
53. An Arithmetic expression in Java involves which Operators or Operations? A. Addition (+), Subtraction (-) B. Multiplication (*), Division (/) C. Modulo Division (%), Increment/Decrement (++/–), Unary Minus (-), Unary Plus (+) D. All the above Answer Option : D
54. Choose the Compound Assignment Arithmetic Operators in Java below. A. +=, -= B. *=, /= C. %= D. All the above Answer Option : D
55. Which is the arithmetic operator in Java that gives the Remainder of Division? A. / B. @ C. % D. & Answer Option : C
56. Arithmetic operators +, -, /, * and % have which Associativity? A. Right to Left B. Left to Right C. Right to Right D. Left to Left Answer Option : B
57. Among Postfix Decrement and Prefix Increment operators in Java, which operator has less priority? A. Postfix Decrement has less priority than Prefix Increment B. Prefix Increment has less priority than Postfix Decrement C. Both operators have same priority D. None of the above Answer Option : B
58. Increment and Decrement arithmetic operators in Java has which Associativity? A. Left to Right B. Right to Left C. Left to Left D. Right to Right Answer Option : B
59. Choose the correct statement about Java Operators +, -, *, / and %. A. + and – have equal priority B. * and / have equal priority C. / and % have equal priority D. All the above Answer Option : D
60. Choose the correct statement about Java Prefix and Postfix operations. A. Prefix operation is carried out immediately and the variable value will be incremented or decremented accordingly B. Postfix operation is carried out on the next line or statement. So the variable value will not change. C. A and B D. None of the above Answer Option : C