Blog Posts - Core Java Interview Question



Why Timestamp cannot be used in place of Date in Java?

One of the tricky question from Java Interview is, "Can we pass a Timestamp instance to a method expecting java.util.Date?", it's a tricky question because the answer is both Yes and No. You can, of course, pass a Timestamp object to a...
by javarevisited on Aug 15, 2016

Java Object Oriented Analysis and Design Problem - Vending Machine Part 2

This is the second part of Java tutorial to show how to create Vending Machine in Java. In the first part, we have discussed problem statement and the solution itself, but unit testing and design document was still pending, which we'll see in thi...
by javarevisited on Jun 7, 2016

Design a Vending Machine in Java - Interview Question

How do you design a Vending Machine in Java? is one of the good Java interview questions mostly asked at Senior level Java developer Interviews. In a typical coding interview, you will be given a problem statement to develop a vending machine and wit...
by javarevisited on Jun 4, 2016

What is difference between Synchronized and Concurrent Collections in Java?

Synchronized vs Concurrent CollectionsThough both Synchronized and Concurrent Collection classes provide thread-safety, the differences between them comes  in performance, scalability and how they achieve thread-safety. Synchronized collections like...
by javarevisited on May 21, 2016

Difference between ExecutorService.submit() and Executor.execute() methods in Java?

What is the difference between Executor.submit() and Executor.execute() method in Java? is one of the good multi-threading questions for experienced Java programmers, mostly asked in Investment Banks like Barclays, Deutsche Bank, or Citibank. A main...
by javarevisited on Apr 19, 2016

Top 50 Java Thread Interview Questions Answers for Experienced

You go to any Java interview, senior or junior, experience or freshers,  you are bound to see a couple of questions from the thread, concurrency, and multi-threading. In fact, this built-in concurrency support is one of the strongest points of Java...
by javarevisited on Mar 9, 2016

9 difference between Array vs ArrayList in Java

Both array and ArrayList are two important data structure in Java and frequently used in Java programs. Even though ArrayList is internally backed by an array, knowing the difference between an array and an ArrayList in Java is critical for becoming...
by javarevisited on Jan 22, 2016

How does Java HashMap or LinkedHahsMap handles collisions?

Prior to Java 8, HashMap and all other hash table based Map implementation classes in Java handle collision by chaining, i.e. they use linked list to store map entries which ended in the same bucket due to a collision. If a key end up in same bucket...
by javarevisited on Jan 7, 2016

Top 20 Core Java Interview Questions and Answers from Investment Banks

Core Java Interview Question Answer This is a new series of sharing core Java interview question and answer on Finance domain and mostly on big Investment bank.Many of these Java interview questions are asked on JP Morgan, Morgan Stanley, Barclays or...
by javarevisited on Nov 5, 2015

133 Java Interview Questions Answers From Last 5 Years - The MEGA List

Time is changing and so is Java interviews. Gone are the days, when knowing the difference between String and StringBuffer can help you to go till the second round of interview, questions are becoming more advanced and interviewers are asking more de...
by javarevisited on Oct 19, 2015

What is Double Brace Initialization in Java? Anti Pattern Example

Double brace initialization is a Java idiom to initialize a Collection like a list, set and map at the time of declaration. At times, you need a list of fixed elements e.g. supported products, supported currencies or some other config, and on the spo...
by javarevisited on Oct 12, 2015

Difference between Java and C++ Constructor - Interview Question

If you are a C++ Programmer, now learning Java then you will find lot of similarity between two of the most popular object oriented programming languages e.g. both support Abstraction, Encapsulation, Class, Object and other OOP concepts. But, they ar...
by javarevisited on Sep 2, 2015

Difference between SOAP and RESTful Web Service in Java

Though both SOAP and RESTful web services allows a client to query server for some information, but the way they are implemented and used is quite different. Main difference between SOAP and REST is that former provides an standard of communication b...
by javarevisited on Aug 31, 2015

Difference between HashMap, LinkedHashMap and TreeMap in Java

Map is one of the most important data structure from Java Collection Framework.  It provides hash table data structure functionality with it's rich implementations like HashMap, Hashtable, LinkedHashMap and little bit of sorting with TreeMap. So...
by javarevisited on Aug 24, 2015

Difference between Dependency Injection and Factory Pattern in Java

TL;DR Main difference between dependency injection and factory pattern is that in case of former dependency is provided by third party (framework or container) while in case of later dependency is acquired by client class itself. Another key differen...
by javarevisited on Jun 30, 2015

3 Ways to Prevent Method Overriding in Java - Private, Static and Final

Every Java programmer knows that final modifier can be used to prevent method overriding in Java because there is now way to override final methods in Java, but apart from final modifier, is there any other way to prevent a Java method to be overridd...
by javarevisited on Apr 8, 2015

Java Clone Tutorial Part 2 - Example to Override with Mutable field

This is the second part of Java tutorial on Cloning, In first part we have seen how clone method works in Java with a simple example of cloning object, with primitives and Immutable. In this tutorial, we will take one step further and override clone...
by javarevisited on Jan 20, 2015

Why Override equals, hashcode and toString method in Java

Couple of questions, which are often asked to me was why do we need to override equals() and hashcode() method, Why should I implement toString(), What will happen if I don't override them or in a different way, I have never overridden equals and...
by javarevisited on Jan 12, 2015

Difference between Bitwsie and Logical Operator in Java - & vs &&, | vs ||

Java beginners often ask same type of questions, and of them is what is difference between & and && operator in Java or difference between | and || operators? Standard answer of this question is well, main difference between & and &am...
by javarevisited on Jan 8, 2015

10 Questions To Make Programming Interviews Less Expensive

Conducting Interview is not cheap and costs both time and money to a company. It take a lot of time to find the right candidate for a job from 100s resume you receive from consultants and agents. They will always tell you that this guy is a Java Guru...
by javarevisited on Sep 17, 2014


Trending Topics

Close