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