Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

Test your skills through the online practice test: Core Java Quiz Online Practice Test

Ques 46. Are true and false keywords?

The values true and false are not keywords.

Is it helpful? Add Comment View Comments
 

Ques 47. Why are there no global variables in Java?

Global variables are considered bad form for a variety of reasons: Adding state variables breaks referential transparency (you no longer can understand a statement or expression on its own: you need to understand it in the context of the settings of the global variables), State variables lessen the cohesion of a program: you need to know more to understand how something works. A major point of Object-Oriented programming is to break up global state into more easily understood collections of local state, When you add one variable, you limit the use of your program to one instance. What you thought was global, someone else might think of as local: they may want to run two copies of your program at once. For these reasons, Java decided to ban global variables.

Is it helpful? Add Comment View Comments
 

Ques 48. Is sizeof a keyword?

The sizeof operator is not a keyword.

Is it helpful? Add Comment View Comments
 

Ques 49. What is the difference between the Boolean & operator and the && operator?

If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.

Is it helpful? Add Comment View Comments
 

Ques 50. Which Java operator is right associative?

The = operator is right associative.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook