Question 1 of 25
Hints left: 3
Q1
Which of the following methods returns proxy object?
Q2
What will be the output of the following Java code snippet? public class Shape { public int area() { return 1; } } public class Rectangle extends Shape { public int area() { return 3; } } class Main() { public static void main(String[] args) { Shape shape = new Shape(); Rectangle rect = new Rectangle(); shape = rect; System.out.println(shape.area()); } }
Q3
What will be the output of the following Java code? public class Shape { public int area() { return 1; } } public class Square extends Shape { public int area() { return 2; } } class Main() { public static void main(String[] args) { Shape shape = new Shape(); Square square = new Square(); square = shape; System.out.println(square.area()); } }
Q4
Which of the following is not a state of object in Hibernate?
Q5
What does Liskov substitution principle specify?
Q6
What will be the output of the following Java code? public class Shape { public int area() { return 1; } } public class Square extends Shape { public int area() { return 2; } } public class Rectangle extends Shape { public int area() { return 3; } } public static void main(String[] args) { Shape square = new Square(); Shape rect = new Rectangle(); square = rect; System.out.println(square.area()); }
Q7
What will be the output of the following Java code? public class Shape { public int area() { return 1; } } public class Square extends Shape { public int area() { return 2; } } public class Rectangle extends Shape { public int area() { return 3; } } class Main() { public static void main(String[] args) { Shape shape = new Shape(); Square square = new Square(); Rectangle rect = new Rectangle(); rect = (Rectangle)square; System.out.println(square.area()); } }
Q8
What will be the output of the following Java code? public class Shape { public int area() { return 1; } } public class Square extends Shape { public int area() { return 2; } } public class Rectangle extends Shape { public int area() { return 3; } } class Main() { public static void main(String[] args) { Shape shape = new Shape(); Square square = new Square(); Rectangle rect = new Rectangle(); rect = (Rectangle)square; System.out.println(square.area()); } }
Q9
Which of the following is good coding practice to determine oddity? i) public boolen abc(int num) { return num % 2 == 1; } ii) public boolean xyz(int num) { return (num & 1)!= 0; }
Q10
What will be the output of the following Java code? public class Shape { public int area() { return 1; } } public class Square extends Shape { public int area() { return 2; } } public class Rectangle extends Shape { public int area() { return 3; } } class Main() { public static void main(String[] args) { Shape shape = new Shape(); Square square = new Square(); Rectangle rect = new Rectangle(); rect = (Rectangle)shape; System.out.println(square.area()); } }
Q11
Which of the following methods hits database always?
Q12
Which of the following is not an advantage of Hibernate Criteria API?
Q13
Which of the following is not a core interface of Hibernate?
Q14
Which of the following is not an advantage of using Hibernate Query Language?
Q15
What data structure should be used when number of elements is fixed?
Q16
What causes the program to exit abruptly and hence its usage should be minimalistic?
Q17
What should the return type of method where there is no return value?
Q18
Which of the following method is used inside session only?
Q19
What will be the correct option of the following Java code snippet? interface ICust { } class RegularCustomer implements ICust { } class OneTimeCustomer implements ICust { }
Q20
SessionFactory is a thread-safe object.
Q21
Which of the following is not an inheritance mapping strategies?
Q22
What will be the output of the following Java code snippet? public class Shape { public int area() { return 1; } } public class Square extends Shape { public int area() { return 2; } } class Main() { public static void main(String[] args) { Shape shape = new Shape(); Square square = new Square(); shape = square; System.out.println(shape.area()); } }
Q23
What will be the output of the following Java code? public class Shape { public int area() { return 1; } } public class Square extends Shape { public int area() { return 2; } } public class Rectangle extends Shape { public int area() { return 3; } } public static void main(String[] args) { Shape shape = new Square(); shape = new Rectangle(); System.out.println(shape.area()); }
Q24
In which file database table configuration is stored?
Q25
Which one of the following causes memory leak?