|Published (Last):||10 October 2018|
|PDF File Size:||12.97 Mb|
|ePub File Size:||20.36 Mb|
|Price:||Free* [*Free Regsitration Required]|
Anonymous September 10, at 9: Tafadzwa Kombe January 5, at Normally 2 to 3 years experience counted as beginners while over 5 years yeara under advanced category, we will see questions from both categories. What is the difference between poll and remove method of Queue interface?
Though Java developer knows about the double primitive type and Qyestions class, while doing floating point arithmetic they don’t pay enough attention to Double. Both are correct, as it will prevent reordering and guarantee visibility.
This explains the output we get from running this program on Windows machines with a US locale. BigDecimal class, whose equals method return java interview questions and answers for 2 years experience pdf download if two BigDecimal object is equal in both value and scale e. Java interview questions and answers for 2 years experience pdf download clarify me why I got exception. There is mechanism called lock striping.
When I asked this question to a couple of programmers they answer differently, one suggests an make both threads synchronized on a common mutex, another one said make both variable volatile.
Anonymous December 17, at 3: December 11, at 3: September 25, at That’s why it’s advised to use Iterator remove method to remove objects from Collection. It can be used in inter-thread communication and also provides built-in thread-safety by using happens-before guarantee. It’s one of the concurrent Collection class yeafs on Java 1. Wrong, it should be: Hi Javin,Great work,your blog is the best way to brush up concepts.
This list is a little bit different and I encourage you to share questions and answers fog a similar way so that it should be easy to revise. However, that’s not what the program prints and that’s why this question is tricky. Pages Anzwers core java spring hibernate collections multithreading design patterns interview questions coding data structure OOP java 8 books About Me.
Further Reading If you are looking for super challenging trick coding questions then you should check out Joshua Bloch another classic book, the Java PuzzlersI am sure you ill find them really challenging to sownload, I certainly did.
How do you remove an entry from a Collection?
Top 10 Tricky Java interview questions and Answers
Newer Post Older Post Home. This is Classical Java Collection interview questions which I have also discussed in my earlier article how questkons HashMap works in Java. See the difference between Synchronized Collection and Concurrent Collection in Java for more details. May 24, at 9: These interview questions seems to be too common and appear in java interview questions and answers for 2 years experience pdf download many interviews and that’s the reason I never asked so called frequently asked or popular interview question, instead I ask something which is not so common like: Particularly 89 – you do not need any mocking library to test a static method – just write a test for it.
Top 10 Tricky Java interview questions and Answers | Java67
It contains interview questions not only from classic topics like threads, collections, equals and hashcode, sockets but also from NIO, array, string, java 8 and much more. Apart from navigation methods, it also provides utilities to create sub-Map e. Compile it and run it. Great list of questions, for more Java interview questions from last 5 years, see exprrience list of Java questions with answers.
Share to Twitter Share to Facebook. See Hash t able vs HashMap in Java for detailed answer of this interview question.
Hope you answer my question here. Patryk Szalanski March 27, at I get confused, because, anawers also removes elements from head and remove is used to remove object, which is passed to it.
Anonymous October 22, at 3: What does the following Java program print? They may be entertaining, but they are intervview bad questions when screening job candidates for real work. It also provide similar methods to get entries e. January 25, at 8: Summary September 27, intterview 2: Fail-fast Iterators throws ConcurrentModificationException when one Thread is iterating over collection object and other thread structurally modify Collection either by adding, removing or modifying objects on underlying collection.
The key also has to be immutable. Set interface and that’s why only contains unique elements, while HashMap allows duplicate values. Hello Javin, Recently I was asked in a Java interview about, aanswers is difference between poll and remove method, if both are used to remove object from Queue.
Actually your questions are better than Javin’s Questions