Interview Questions and Answers - Order By Newest Q631. Give an Example for Builder Pattern ? Core Java
Ans. String str = new StringBuilder().append("Buggy").append("Bread").toString(); Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   builder pattern   design pattern   stringbuilder   string Asked in 3 Companies Try 1 Question(s) Test Q632. Is this Polymorphism ?
Map<String, List<String>> inventoryManagerCountMap = new HashMap<String, ArrayList<String>>(); Core Java
Ans. No. This will result in compilation error as Polymorphism cannot be performed on Object types. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   polymorphism  object oriented programming (oops)  oops conceptsRarely asked as it was introduced with Java 8. Q633. Difference between DoubleSummaryStatistics , IntSummaryStatistics and LongSummaryStatistics ? Core Java
Ans. They all does the same task i.e to compute statistical information on the stream of data. They differ by the way they store the statistical information as they expect a different data type of the values being used. IntSummaryStatistics and LongSummaryStatistics expect non floating point values and hence stores the statistical information like min,max and sum as non floating values ( int or long ) whereas DoubleSummaryStatistics stores these information as floating value. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java8   java 8   lambda expressions   doublesummarystatistics   intsummarystatistics   longsummarystatistics   summarystatistics Q634. Have you ever used StringTokenizer ? Core Java
Ans. No, Alternatively I have used String.split("\\s") for achieving the same function. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   string   stringtokenizer Q635. What is ConcurrentLinkedDeque ? Core Java
Ans. It's a Collections concrete class that provides implementation of a Double Ended queue that allows concurrent insertion, removal, and access operations that can be executed safely across multiple threads. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   queue   deque   concurrent collections Q636. What is CopyOnWriteArrayList ?
Ans. Its a type of ArrayList in which all Write operations , i.e add and set are performed by creating a new copy. This array never changes during the lifetime of the iterator, so it never throws ConcurrentModificationException Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   list   arraylist   copyonwritearraylist   ConcurrentModificationException Asked in 1 Companies Q637. What are the advantages and disadvantages of CopyOnWriteArrayList ? Core Java
Ans. This collections class has been implemented in such a manner that it can never throw ConcurrentModificationException. As it performs update and write operations by creating a new copy of ArrayList, It's slower compared to ArrayList. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   list   arraylist   copyonwritearraylist   advantages-disadvantages   ConcurrentModificationException Asked in 4 Companies Expert Q638. Name few Concurrent Collection Classes ?
Ans. ConcurrentHashMap ConcurrentLinkedDeque ConcurrentLinkedQueue ConcurrentMap ConcurrentNavigableMap ConcurrentSkipListMap ConcurrentSkipListSet Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   concurrent collections Q639. Name few Collections Map implementations ?
Ans. AbstractMap ConcurrentHashMap ConcurrentSkipListMap EnumMap HashMap IdentityHashMap LinkedHashMap SystemFlavorMap TreeMap WeakHashMap Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   map Q640. What is ArrayIndexOutOfBoundException ? Core Java
Ans. Exception thrown by the application is we try to access an element using an index which is not within the range of array i.e lower than 0 or greater than the size of the array. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   exceptions   arrayindexoutofboundexception Asked in 1 Companies Q641. how can we generate JavaDoc documentation for our code ? Eclipse
Ans. In Eclipse, Go to File -> Export -> Java -> JavaDoc Select the projects , other properties and output directory for which JavaDoc and Click Finish. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   javadoc   eclipse Q642. Can we initialize member variables within static block ?
Ans. Static block is like static method that gets executed upon class loading. The way static method allows accessing member variables ( using object references only ), the same static block can also access and initialize member variables. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   static block Q643. Name few interfaces that extends Collection Interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-interfaces-that.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   collection interface Q644. Name few classes that extends Number Class ?
Ans. http://www.buggybread.com/2015/02/java-util-classes-that-inherit-number.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   data types   number class Q645. Name few classes that extend Thread class ? Core Java
Ans. http://www.buggybread.com/2015/02/java-threads-classes-that-inherit.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   threads   multithreading   thread class Asked in 1 Companies Q646. Name few classes that extends Collections class ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-inherit.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   collections class Q647. Name few Date and Time Classes you have used in your projects ?
Ans. http://www.buggybread.com/2015/02/java-util-date-time-classes-and.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   util   java.util.date   time Q648. Name few Calendar related classes and Interfaces ?
Ans. http://www.buggybread.com/2015/02/java-util-calendar-classes-and.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   util   java.util   calendar Q649. Name few abstract classes of Java collections framework ?
Ans. http://www.buggybread.com/2015/02/java-collections-abstract-classes.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections Q650. Name few classes that implement Cloneable interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-implement_58.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   cloneable  cloning Q651. Name few classes that implement Set interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-implement_78.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   set Q652. Name few classes that implement iterable interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-implement_45.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   iterable Q653. Name few classes that implement Map interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-implement_82.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   map Q654. Name few classes that implement List interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-implement_35.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   list Q655. Name few classes that implement Queue interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-implement_1.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections.queue Q656. Name few classes that implement Collection interface ?
Ans. http://www.buggybread.com/2015/02/java-collections-classes-that-implement.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   collection interface Q657. Name few classes java provides for File compression ?
Ans. http://www.buggybread.com/2015/01/java-zip-classes-and-interfaces.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   zip Q658. Name few Buffered IO classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-io-buffered-classes-and-interfaces.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   io   input output   buffered io   buffered input output Q659. Name few Locale classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-locale-classes-and-interfaces.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   util   java.util   locale intermediate   rare Q660. Name few Hash collections classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-hash-collections-classes-and.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   hash collections