Posts

Showing posts with the label Java Interview Question and Answer

Core Java Interview Question and Answer PowerPoint

Java Interview Question and Answer SET 2

Image
1.       If you access an uninitialized local variable will result? Syntax Error Compile Time Error Run Time Error No Error 2.       Which is right way to declare Array? int[] myArray; int myArray[]; int []myArray; A and B Both 3.       Overloaded methods are differentiated by Number of arguments Data type of arguments Number and the Data type of the arguments None of the above 4.       A constructor that is automatically generated in the absence of explicit constructors called? Default Constructor Nullary Constructor Empty Constructor All the above 5.       Which package does define String and String Buffer classes? 6.       Which of these is supported by method overriding in Java? a) Abstraction b) Encapsulation c) Polymorphism d) None of the m...

Java Interview Question and Answer SET 1

Core Java Placement Questions 1.       What happens when the following program is compiled and executed with the command - java test? Select the one correct answer. class test { public static void main (String args[])  {      If (args.length > 0)         System.out.println(args.length);     } } (A) The program compiles and runs but does not print anything. (B) The program compiles and runs and prints 0 (C)  The program compiles and runs and prints 1 (D) The program compiles and runs and prints 2 2.       What happens when the following program is compiled and then the command "java check it out" is executed. Select the one correct answer. class check { public static void main(String args[]) { System.out.println(args[args.length-2]); } }      (A) The program compiles but generates...