Question 1 of 25
Hints left: 3
Q1
In which file database table configuration is stored?
Q2
Which of the following is not a core interface of Hibernate?
Q3
Which of the following is not an inheritance mapping strategies?
Q4
Which of the following method is used inside session only?
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; } } 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()); } }
Q7
What causes the program to exit abruptly and hence its usage should be minimalistic?
Q8
Which of the following methods returns proxy object?
Q9
Which of the following is not a state of object in Hibernate?
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
What should the return type of method where there is no return value?
Q12
SessionFactory is a thread-safe object.
Q13
Which of the following is not an advantage of Hibernate Criteria API?
Q14
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()); }
Q15
Which of the following methods hits database always?
Q16
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()); } }
Q17
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()); } }
Q18
What data structure should be used when number of elements is fixed?
Q19
What will be the correct option of the following Java code snippet? interface ICust { } class RegularCustomer implements ICust { } class OneTimeCustomer implements ICust { }
Q20
Which of the following is not an advantage of using Hibernate Query Language?
Q21
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()); } }
Q22
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()); }
Q23
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; }
Q24
Which one of the following causes memory leak?
Q25
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()); } }