Interview Questions and Answers - Order By Newest Ans. The interface is a mechanism to achieve abstraction. Interfaces can have abstract methods and variables. It cannot have a method body. Sample Code for interface Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  interface Asked in 1 Companies basic   frequent Q62. How do you define a functional interface? Core Java
Ans. Create interface with the only one non-overriding abstract method and annotate it with @FunctionalInterface Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  functional interface  java 8 Asked in 1 Companies Q63. Can we have interface as a replacement for utility class ? Core Java
Ans. Yes, With Java 8 we can use Interfaces as collection of utility methods through the use of default methods. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 8  interfaces  utility class   utility classes Q64. Can we declare constructor inside an interface ? Why ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  interface   constructor Q65. Does Java generate .class file for interfaces ? Core Java
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  .class file  java byte code  interfaces Q66. Which Java version supports Interface Default methods ? Core Java
Ans. Java 1.8 or Java 8 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  default methods   interface default methods   java 8  java 8 features This question was recently asked at 'Oracle financial services'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  interface vs abstraction  interfacing vs abstraction  relation between interface and abstraction  How interface provide abstraction Asked in 1 Companies Q68. Explain interfaces in Typescript. How is it different compared to other languages ? TypeScript
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  interfaces in typescript Q69. Which method needs to be implemented if a class is implementing comparable interface ? Core Java
a. comp b. compare c. compareTo d. compareEqualsAns.c. compareTo
Q70. If X implements Y and Y extends Z, Which of the following initialization is correct ? Core Java
a. X x = new Y(); b. X x = new Z(); c. Z z = new Y(); d. Z z = new X();Ans.d. Z z = new X();
Q71. If class A implements X interface, and Class B implements Y interface, and X is the parent of Y, Which of the following initialization is correct ? Core Java
a. A a = new B(); b. Y y = new A(); c. X x = new B(); d. Y y = new A();Ans.c. X x = new B();
Q72. Which of the following is a Marker Interface ? Core Java
a. Runnable b. Serializable c. Cloneable d. Both Serializable and CloneableAns.d. Both Serializable and Cloneable
Q73. Which of following can be nested into another ? Core Java
a. class within another class b. class within interface c. interface within class d. All of aboveAns.d. All of above
Q74. Which of following is not core interface of Hibernate ? Hibernate
a. Session b. Transaction c. SessionFactory d. TransactionFactoryAns.d. TransactionFactory