Top 20 Java Interview Questions | Top 20 Core Java Interview Question Series | Part 5
Top 20 Java Interview Questions | Core Java Interview Question Series | Part 5
Q.81). What is the logical operator?
Ans. It is used to combine the conditions. It always returns the boolean values as a result
Q.82). What is the relational operator?
Ans. It is used to make conditions. It always returns a boolean value as a result
Q.83). What is dynamic reading?
Ans. The process of reading data from the user through the keyboard at the execution time of the program is known as dynamic reading.
Q.84). What are the steps for dynamic reading?
Ans.Â
- Import scanner class
- Create an object for the scanner class by using reference variable
Q.85). What are the control statements?
Ans. Control statements are used to control the program's flow of execution. It is of three types
- Decision-making statement
- Branching statement
- Looping statement
Q.86). What are the decision-making statements?
Ans. Decision making statements help the programmer to skip the block of instruction from execution if the condition is not satisfied.
Q.87). What are the types of decision making statment?
Ans.Â
- If statement
- if-else statement
- if else if ladder
- switch statement
Q.88). Can we pass long, float, double, or boolean values for the switch case statement?
Ans. No, we cannot pass long, float, double, or boolean values for the switch case statement
Q.89). What is the break statement?
Ans. Break is a keyword. It is a control transfer statement. Break is used inside the switch or loop block. When the break statement is executed, control is transferred outside the block.
Q.90). What is grouping in the switch statement?
Ans. When inside the switch statement, multiple cases have the same block of execution instead of writing the same block of execution again and again for every case, we can go for grouping.Â
To take all the cases together which have the same block of execution and only once we can write the execution block at the last case.
Q.91) What are the looping statements?
Ans. It allows you to repeatedly execute a block of code until a specified condition is met. It is of four types 1). While loop 2). Do-while loop 3). For loop 4). For each/advanced for loop/enhanced for loop
Q.92). What is a method?
Ans. It is a block of instruction which is used to perform some specific task is known as method. Method will be only executed when we will call it. Without calling a method, it would not be executed. We are creating the method inside the class block directly. We cannot define a method within another method, but we can invoke a method from another method as often as we like.
Q.93). What is method definition?
Ans. It is a combination of method declaration and method implementation.
Q.94). What is method declaration?
Ans. It is the combination of access modifier, modifier, return types, and method signature.
Q.95). What is method signature?
Ans. It is the combination of method name and formal arguments
Q.96). What is method implementation or method body?
Ans. It is also known as the method body where we are writing the instruction which is going to execute when the method is called.
Note: Software testing jobs service
Q.97). What is the modifier?
Ans. It is used to change the characteristics of Java components. We are using some keywords as modifiers such as static, final, volatile, abstract, transient, and synchronized.
Q.98). What is static?
Ans. It is a modifier. We are using it with variables and methods. If the method is static, then we can call the method without creating the object of the class.
Q.99). Why we are using static keyword in main method of Java?
Ans. We are using static keyword in the main method of Java so that JVM(Java virtual machine) can call it directly without creating the object of that class.
Q.100). Why the main method is public?
Ans. If any method is public then we can access it from any where. We can access it from outside the class also. JVM is outside the class and to execute the program JVM call the main method so it is public.
Q.101). What is final?
Ans. If we are making a variable final, we cannot reinitialize the variable but we can access and reaccess as many times as we want.
Post a Comment