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. No, Java doesn't have a sizeOf operator. In C / C++ , its required to determine how much memory allocation is required which is not the case with Java. Java handles memory allocation and deallocation intrinsically. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  sizeOf  size of object  sizeOf operator Asked in 1 Companies   rare | |||||||||||
| |||||||||||
Ans. Enumeration Iterator List iterator | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  cursors  iterator | |||||||||||
| |||||||||||
Ans. Its used to access the object properties using the object reference or class properties using the Class Name. Moreover its used to access the classes and Interfaces of a package. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  operators | |||||||||||
| |||||||||||
Ans. && - AND || - OR ! - LOGICAL NOT | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  operators Basic | |||||||||||
| |||||||||||
Ans. && is a Logical whereas & is a bitwise operator | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  operators  logical vs bitwise operator | |||||||||||
| |||||||||||
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. Sample Answers - Getting better with upcoming technologies and be a Lead developer. In accordance with the company, working as a permenant employee. Be an associate architect. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 2 Companies | |||||||||||
| |||||||||||
Ans. http://introcs.cs.princeton.edu/java/11precedence/ | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  operators  operator precedence basic | |||||||||||
| |||||||||||
Ans. Mutator is another name for setter methods, i.e the method allows for mutating the property of an object and eventually the state of the object. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  setter method  mutator | |||||||||||
| |||||||||||
Ans. Garbage collection mechanism frees up the memory that is no longer needed. In languages like C / C++ the deallocation needs to be done explicitly by the programmer and hence any leniency may result in memory leak. Garbage collection in java ensures that all unused memory is reclaimed and hence there are no memory leaks.Moreover it relieves the programmer from the hassle of carefully releasing all memory. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  Garbage Collection  memory management Asked in 2 Companies | |||||||||||
| |||||||||||
This question was recently asked at 'Acute Informatics,General Atomics'.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 2 Companies | |||||||||||
| |||||||||||
Ans. Enumeration can iterate only legacy collections like Vector , HashTable and Stack whereas Iterator can iterate both legacy and non legacy collections. Enumeration is less safer than Iterator Enumeration is fail safe whereas Iterator is fail fast Iterator allows for removal of element while traversal whereas Enumeration doesn't have remove method. Enumerations were introduced in Java 1 whereas Iterators were introduced with Java 2 Enumerations have methods like hasMoreElements and nextElement whereas Iterators have methods like hasNext, next and remove | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  enumeration vs iterator  collections Basic   frequent | |||||||||||
| |||||||||||
Ans. >= => will result in error. => somewhat looks like lambda operator "->" | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  operators  >= operator  greater than and equal to operator  comparison operators | |||||||||||
| |||||||||||
Ans. Ternary operator , also called conditional operator is used to decide which value to assign to a variable based on a Boolean value evaluation. It is used as condition ? value1 : value2 For example int y = (x > 0) ? x:0; // assign x if it's greater than 0, else assign 0 | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  operator  ternary operator Basic | |||||||||||
| |||||||||||
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  operator overloading | |||||||||||
| |||||||||||
Ans. This can be done using a Spliterator. LinkedList list = Arrays.asList("names","numbs","birds","animals"); Spliterator split1 = list.Spliterator(); Spliterator split2 = split1.Spliterator(); Now, the LinkedList is split into split1 and split2. use split2 first then split1 to check the output. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java 8  parallel stream  spliterator Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. There are four main OOP concepts in Java. These are: Abstraction. Abstraction means using simple things to represent complexity. We all know how to turn the TV on, but we don?t need to know how it works in order to enjoy it. In Java, abstraction means simple things like objects, classes, and variables represent more complex underlying code and data. This is important because it lets avoid repeating the same work multiple times. Encapsulation. This is the practice of keeping fields within a class private, then providing access to them via public methods. It?s a protective barrier that keeps the data and code safe within the class itself. This way, we can re-use objects like code components or variables without allowing open access to the data system-wide. Inheritance. This is a special feature of Object Oriented Programming in Java. It lets programmers create new classes that share some of the attributes of existing classes. This lets us build on previous work without reinventing the wheel. Polymorphism. This Java OOP concept lets programmers use the same word to mean different things in different contexts. One form of polymorphism in Java is method overloading. That?s when different meanings are implied by the code itself. The other form is method overriding. That?s when the different meanings are implied by the values of the supplied variables. See more on this below. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  oops  oops concepts Asked in 16 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. No,we cannot.I t will give concurrentModificationExceptin error. It can be resolved by using ConcurrentClasses like ConcurrentHashMap,CopyOnWriteArrayList,BlockingQueue etc which are fail-safe and wont give exception. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  collections  list  iterator Asked in 1 Companies basic | |||||||||||
| |||||||||||
This question was recently asked at 'Atos'.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. The garbage collection is a facility wherein a program runs on the Java Virtual Machine which gets rid of objects, which are not being used by a Java application anymore. It is a form of automatic memory management and recollection. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 4 Companies | |||||||||||
| |||||||||||
Ans. O(1) for ArrayList O(n) for LinkedList | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 2 Companies | |||||||||||
| |||||||||||
Ans. == compares values === is used in scripting languages for comparing two values as well as there data tpe. like in js,php. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  ==  ===  == vs === Asked in 13 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. Using comparable and comparator and sorted collections like TreeSet or TreeMap. or use stream api from java 8 onwards which internally refers to comparable and comparator through lambda expressions | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  sort  sorting  comprator  comparable  treeset  treemap  sorting collections Asked in 1 Companies Basic   frequent | |||||||||||
| |||||||||||
This question was recently asked at 'Exterro,Equator Business Solutions'.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 2 Companies | |||||||||||
| |||||||||||
Ans. Route 53 | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  AWS DNS  aws Route 53 Asked in 4 Companies | |||||||||||
| |||||||||||
Ans. Cname doesn't support naked domain names whereas aliasis does. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  aws route53 Asked in 3 Companies | |||||||||||
| |||||||||||
Ans. CustomArrayList myarrayList = new CustomArrayList(); myarrayList.add("Value 1"); myarrayList.add("Value 2"); myarrayList.add("Value 3"); for (String string : myarrayList) { System.out.println(string); } package sample.utils; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class CustomArrayList implements Iterable { private ArrayList mylist = new ArrayList(); public void add(T t) { this.mylist.add(t); } @Override public Iterator iterator() { return new CustomIterator(mylist); } class CustomIterator implements Iterator { private int indexPosition = 0; private List internalList; public CustomIterator(List internalList) { this.internalList = internalList; } @Override public boolean hasNext() { if (internalList.size() >= indexPosition 1) { return true; } return false; } @Override public E next() { E val = internalList.get(indexPosition); indexPosition ; return val; } } } | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  iterator Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. All threads share a common heap. Each thread has a private stack, which it can quickly add and remove items from. This makes stack based memory fast, but if you use too much stack memory, as occurs in infinite recursion, you will get a stack overflow. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  memory management  heap memory 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 | |||||||||||
| |||||||||||