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 for 'Infoview technologies' - 16 question(s) found - Order By Newest
Very frequently asked. Among first few questions in almost all interviews. Among Top 5 frequently asked questions. Frequently asked in Indian service companies (HCL,TCS,Infosys,Capgemini etc based on multiple feedback ) and Epam Systems
Ans. "equals" is the method of object class which is supposed to be overridden to check object equality, whereas "==" operator evaluate to see if the object handlers on the left and right are pointing to the same object in memory.
x.equals(y) means the references x and y are holding objects that are equal. x==y means that the references x and y have same object.
Sample code:
String x = new String("str");
String y = new String("str");
System.out.println(x == y); // prints false
System.out.println(x.equals(y)); // prints true
Ans. Abstract classes can have both abstract methods ( method declarations ) as well as concrete methods ( inherited to the derived classes ) whereas Interfaces can only have abstract methods ( method declarations ).
A class can extend single abstract class whereas it can implement multiple interfaces.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Earlier any class implementing an interface was supposed to implement all methods declared in an interface. There was no place for optionally implementing all or subset of methods.Though we have abstract classes wherein we could have provided such a mechanism by declaring some methods as abstract while providing definition for some. But as Abstract classes have a body and are comparatively heavier than interfaces and interfaces associate closely to the concept of providing interfacing than abstract classes, Java might have though of providing optional implementation for default methods. This way same interface can be reused in variety of ways rather than making copies of an interface to suit different needs.
Help us improve. Please let us know the company, where you were asked this question :
Ans. JRE or Java Runtime Environment is the Java Virtual Machine on which class files are executed. It includes borwser plugins that facilitates execution of class files in browsers.
JDK or Java Development Kit includes JRE , compiler and development tools.
Help us improve. Please let us know the company, where you were asked this question :
Ans. We creates separate branches for each project if development work is going on parallel and they are to be released at different times. Once the first release is done, we merge the branch changes into trunk. If they all have to go at one time, we usually would merge everything in the trunk itself.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Collections in java is a framework of classes that provides an abstracted data structure to store and manipulate the group of objects. Each class is unique in the way it stores , search , sort and modify the elements.
Help us improve. Please let us know the company, where you were asked this question :
Ans. int[] arr = {1,-1,2,-3,3,-4,4,5,6,-5,-6,-7,-8,8,9,-9};
List positiveNumbers = new ArrayList<>();
List negativeNumbers = new ArrayList<>();
for(int i = 0; i < arr.length(); i ){
if(I < 0){
negativeNumbers.add(i);
} else {
positiveNumbers.add(i);
}
}