25. Does importing a package imports the subpackages as well? Example: Does importing com.MyTest.* also import com.MyTest.UnitTests.*? No you will have to import the subpackages explicitly. Importing com.MyTest.* will import …
Questions and Answers
- Interview Questions and AnswersJava ProgrammingTechnical Interview Questions and Answers
- Interview Questions and AnswersJava ProgrammingTechnical Interview Questions and Answers
Java Basics Interview Questions and Answers For Freshers and Experience Part-3
by Sby S19. Can an application have multiple classes having main() method? Yes it is possible. While starting the application we mention the class name to be run. The JVM will look …
- Interview Questions and AnswersJava ProgrammingTechnical Interview Questions and Answers
Java Basics Interview Questions and Answers For Freshers and Experience Part-2
by Sby S13. What if I write static public void instead of public static void? Program compiles and runs properly. 14. What if I do not provide the String array as the …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Core Java Interview Questions and Answers For Freshers and Experience Part-22
by Sby S27. How does Java handle integer overflows and underflows? It uses those low order bytes of the result that can fit into the size of the type allowed by the …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Core Java Interview Questions and Answers For Freshers and Experience Part-21
by Sby S121. To what value is a variable of the String type automatically initialized? The default value of an String type is null. 122. What is the difference between a field …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Core Java Interview Questions and Answers For Freshers and Experience Part-20
by Sby S115. What is constructor chaining and how is it achieved in Java ? A child object constructor always first needs to construct its parent (which in turn calls its parent …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Core Java Interview Questions and Answers For Freshers and Experience Part-19
by Sby S109. What is the difference between an if statement and a switch statement? The if statement is used to select among two alternatives. It uses a boolean expression to decide …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Core Java Interview Questions and Answers For Freshers and Experience Part-18
by Sby S103. What is the difference between a public and a non-public class? A public class may be accessed outside of its package. A non-public class may not be accessed outside …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Core Java Interview Questions and Answers For Freshers and Experience Part-17
by Sby S97. What are the legal operands of the instanceof operator? The left operand is an object reference or null value and the right operand is a class, interface, or array …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Core Java Interview Questions and Answers For Freshers and Experience Part-16
by Sby S91. Name the eight primitive Java types. The eight primitive types are byte, char, short, int, long, float, double, and boolean.