Java Short Answer type Questions



1.What are command line arguments?
The values that are passed to the main method from the command line while executing the program are called as command line arguments.

2. What are the various types of operators available in java?


Arithmetic operator, Relational operator, Logical operator, Bitwise operator, Increment and decrement operator, Assignment operator, Conditional operator and Special Operator.

3. What is a ternary operator?
The operator that takes three arguments is called as the ternary operator. The conditional operator is the only ternary operator available in java.

4. What is the use of Integer.parseInt() method?
This method is used to convert the String object into an integer value.

5. What is called as a Boolean expression?
An expression that returns either true or false value is called a Boolean expression.

6. What is a control structure?
Control structures are statements that are used to change the flow of the program based on some condition.

7. What are the two types of control structures?
Decision-making statements and Looping statements

8. What is decision making statements?
The statements that are used to execute only a block of code and leaving others based on the condition.

9. What is the use looping statement?
The looping statement is used to execute a block of repeatedly until the condition is true.

10. What is the difference between while and do..while?


In case of while statement the block of code will not be executed at least once if the condition is false at the first run.
In case of do..while statement the block of code will be executed at least once if the condition is false at the first run.
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: