Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| |||||||||||
Interview Questions and Answers - Order By Newest | |||||||||||
| |||||||||||
Ans. As Class B has been declared abstract , we can either implement any of these methods and just declare rest of them abstract. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  interfaces  abstract classes  code  coding | |||||||||||
Try 2 Question(s) Test | |||||||||||
| |||||||||||
Ans. It should either implement the abstract methods or re-declare them abstract. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract class Asked in 2 Companies Basic   Frequent | |||||||||||
Frequently asked to Fresh graduates. | |||||||||||
| |||||||||||
Ans. http://algs4.cs.princeton.edu/11model/BinarySearch.java.html | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  binary search  search Asked in 5 Companies basic   frequent | |||||||||||
Try 1 Question(s) Test | |||||||||||
| |||||||||||
Ans. No. Static methods cannot be overridden and hence make no sense to be declared abstract. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  main method   abstract | |||||||||||
Try 1 Question(s) Test | |||||||||||
| |||||||||||
Ans. Abstract classes provide a mechanism of interfacing ( using abstract method ) as well as inheritance ( extending abstract class ). So they should be used in place of interfaces in case there is some code ( methods ) or object body ( member elements ) that can be reused with inheritance. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract classes Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. Abstraction, Encapsulation, Polymorphism , Composition and Inheritance | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  core oops concepts Asked in 65 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. import java.util.*; class LinkedListSolution{ protected LinkedList list; public LinkedListSolution(){ list = new LinkedList(); } public Object pop() throws NoSuchElementException{ if(list.isEmpty()) throw new NoSuchElementException(); else return list.removeFirst(); } public void push(Object obj){ list.addFirst(obj); } public Object peek() throws NoSuchElementException{ if(list.isEmpty()) throw new NoSuchElementException(); else return list.getFirst(); } public boolean isEmpty(){ return list.isEmpty(); } public String toString(){ return list.toString(); } } class TestStack{ public static void main(String args[]){ LinkedListSolution s = new LinkedListSolution(); s.push("First"); s.push("Second"); s.push("Third"); System.out.println("Top: " s.peek()); s.push("Fourth"); while(!(s.isEmpty())) System.out.println(s.pop()); } } | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  Linkedlist  data structures  algorithm Asked in 2 Companies basic | |||||||||||
| |||||||||||
This question was recently asked at 'Kony Labs'.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   Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. Abstract methods are the methods that need to be overridden in the derived class ( either as implementing method or again abstract method ) so it's not only allowed but its required to override abstract method in the derived class. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  overriding  abstract methods  overriding abstract methods | |||||||||||
| |||||||||||
Ans. Yes, but in that case the derived class itself should be abstract. We cannot have an object of a class without definition for the method which has been declared abstract in the parent. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  overriding  overriding abstract methods  abstract methods | |||||||||||
| |||||||||||
This question was recently asked at 'Y Media Labs'.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  log4j vs slf4j Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. The objective of an abstract class is to provide an interface as well as code reuse. Though we cannot instantiate an instance of abstract class but we can reuse the code by extending such a class. Moreover abstract class provides interfacing to outside components just like interfaces. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract class | |||||||||||
| |||||||||||
Ans. Because Abstract class is incomplete i.e there are abstract methods that needs to be defined by extending classes. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract class | |||||||||||
| |||||||||||
This question was recently asked at 'ABS'.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   Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.JVMs are available for many hardware and software platforms (i.e. JVM is platform dependent).Runtime Instance Whenever you write java command on the command prompt to run the java class, an instance of JVM is createdThe JVM performs following operation:Loads codeVerifies codeExecutes codeProvides runtime environment | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  memory management  jvm Asked in 3 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. Abstract classes provide a mechanism of interfacing ( using abstract method ) as well as code reuse through inheritance ( extending abstract class ) Comparing to concrete class they have an advantage of providing interface which a concrete class doesn't provide. Comparing to interfaces they have an advantage of providing code reuse through inheritance which interfaces dont provide. | |||||||||||
Sample Code for abstract class | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract class  importance of abstract class Basic   frequent | |||||||||||
| |||||||||||
This question was recently asked at 'Ola Cabs'.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  program  code  coding  insertion sort   sort Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. Loose Coupling Facilitates designing complex applications by making them modular. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  oops concepts  abstraction Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. Abstract Classes provide default implementations of methods that are inherited by the classes that extend them, which was not the case for Interfaces. This changed in Java 8, where default implementations are provided for methods. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract classes  interfaces  default method Asked in 1 Companies expert | |||||||||||
| |||||||||||
This question was recently asked at 'Intel'.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  abstraction  oops concepts Asked in 1 Companies basic | |||||||||||
| |||||||||||
Ans. The Java collections framework (JCF) is a set of classes and interfaces that implement commonly reusable collection data structures. Although referred to as a framework, it works in a manner of a library. The JCF provides both interfaces that define various collections and classes that implement them. | |||||||||||
Sample Code for Map Sample Code for HashMap Sample Code for Treemap Sample Code for set Sample Code for hashset Sample Code for treeset Sample Code for list Sample Code for arraylist Sample Code for linkedlist Sample Code for queue Sample Code for priorityqueue Sample Code for concurrenthashmap Sample Code for vector Sample Code for stack | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  collections Asked in 9 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. Yes | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract keyword | |||||||||||
| |||||||||||
Ans. hibernate-orm hibernate-validator hibernate-ogm hibernate-search or you can download hibernate core with all dependencies. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate jar files   hibernate Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. Abstract Class is a class that's only allowed to be a Base class for it's usage. It can never be instantiated on it's own. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  base class  abstract class basic | |||||||||||
| |||||||||||
Ans. Yes, an abstract class can extend another class. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract class | |||||||||||
| |||||||||||
Ans. Yes, an abstract class can have a constructor in Java. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract class  public constructor Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. SNMP or Simple Network Management protocol is an application layer protocol for exchanging management information between network devices. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 15 Companies | |||||||||||
| |||||||||||
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 | |||||||||||
| |||||||||||
| |||||||||||