Top 10 Java Interview Questions for 2 to 3 years experience - Answered

Java Interview Questions 2 to 4 years of experience
If you are a Java programmer with 2 to 3 years experience of working in Java and looking for a job change then it's better to know what is expected from 2 to 3 years experienced Java programmer in a typical core Java or J2EE interview. Since 2 to 3 years is not a vast experience and you still fall under beginner to the intermediate category, it's not expected from you to have done profiling, Garbage collection tuning, designing complex Java applications, or even creating concurrent Java design patterns. 

Is Java a Pure Object Oriented Programming Language?

Hello guys, today, I am going to discuss one of the oldest questions related to Java, whether Java is a pure object-oriented language or not? The short answer is no. My answer is based on the fact that in a pure object-oriented language everything is an object and there are many things in Java that are not objects like primitive data types like boolean, char, short, int, long, float, double, different kinds of arithmetic, logical and bitwise operator like +, -. *, /, &&, || etc. There are only a few pure OO programming languages are Smalltalk and Eiffel, If there is more, I may not know but Smalltalk is often touted as the purest form of an object-oriented language.

What is Method Overloading in Java? An Example

What is method overloading in Java?
Method overloading in Java is an object-oriented programming concept that allows a programmer to declare two methods of the same name but with different method signatures, like a change in the argument list or a change in the type of argument. Method overloading is a powerful Java programming technique to declare a method that does a similar job but with a different kind of input. One of the most popular examples of method overloading is the System.out.println() method whose job is to print data on the console. This method is overloaded to accept all kinds of data types in Java. 

What is Method Overriding in Java ? Example Tutorial

Method overriding in Java
Method overriding in Java is a concept based on polymorphism OOP concept allows the programmer to create two methods with the same name and method signature on the interface and its various implementation and the actual method is called at runtime depending upon the type of object at runtime. Method overriding allows you to write flexible and extensible code in Java because you can introduce new functionality with minimal code change. Method overriding is different than the method overloading in Java which we have discussed in the last article.

Can we Overload static method in Java? Program - Example

Overloading static method In Java
Yes, we can overload the static method in Java. In terms of method overloading, the static method is just like normal methods. To overload the static method, you need to provide another static method with the same name but a different method signature. The static overloaded method is resolved using Static Binding during compile time. The overloading method in Java is completely different than the overriding method. As discussed in the last article, we can not override the static method in Java, but we can certainly overload a static method in Java. Here is an example that confirms that we can overload static method in Java:

Top 10 Tricky Java interview questions and Answers

What is a tricky question? Well, tricky Java interview questions are those questions that have some surprise element on them. If you try to answer a tricky question with common sense, you will most likely fail because they require some specific knowledge. Most of the tricky Java questions come from confusing concepts like method overloading and overriding, Multi-threading which is really tricky to master character encoding, checked vs unchecked exceptions, and subtle Java programming details like Integer overflow. The most important thing to answer a tricky Java question is attitude and analytical thinking, which helps even if you don't know the answer. 

Top 10 RESTful Web Service Interview Questions for Java Developers

REST is an architectural style of developing web services that have become immensely popular in the last couple of years and consequently gained a lot of importance in core Java and Java EE interviews. If you are a Java web developer, then you are most likely to see a couple of questions from web services every time you go for a Java web developer interview. One of the most frequent ones is the difference between REST and SOAP web services, which I have recently answered there, but there are a lot many other good questions I have collected from friends and my readers, which I have not yet published. In this article, I am sharing those questions, mainly based on REST-style web services for your practice and preparation.

Top 15 Recursion Programming Exercises for Java Programmers with Solution

Hello guys, if you are trying to learn recursion but struggling and looking for some common recursive coding problems then you have come to the right place. Earlier, I have shared frequently asked programming interview questions, books, and courses and in this article, I will share 15 coding exercises you can do to learn recursion from scratch. These are common coding problems that can be solved using recursion, these will not only help in learning recursion but also in your coding interview preparation. I personally found the best way to learn Recursion in Java or any programming language is by doing some examples. 

Top 12 Java Thread, Concurrency, and Multithreading Interview Questions Answers

Hello guys, Multithreading is an important feature of the Java programming language, which means threads are also an important part of any Java interview. It's true and in fact, at beginners and freshers, level Thread interview questions in Java are one of the most difficult to answer. One reason for interview questions related to multithreading and concurrency being difficult is confusion around how multiple threads work together and the second is threads are genuinely a complicated topic to understand and use correctly.

How to use fixed size thread pool Executor in Java? Example Tutorial

We are again with new article that is on using fixed size thread pool executor in Java. The main aim of this article is to give you idea about how to declare string in java and about different ways of declaring. So our viewer will have great knowledge after reading this. If you don't know, a FixedSizeThreadPool is a type of Java Executor that uses a fixed number of threads to carry out tasks. When you have a small number of tasks to complete and want to manage the number of threads that can be used to complete those tasks, this kind of executor is helpful.

Top 20 Essential Java Interview Questions with Answers for Freshers with 1 to 2 years Experienced

If you are a grad looking for an internship position in a company that uses Java, or a fresher, just out from college and looking out for a Java development position, then this post is for you. I have attended, taken, and participated in different levels of Java interviews. I can say there is a vast difference between them, which is not surprising because you obviously want to ask different level questions based upon whether the candidate is fresher or experienced. Similarly, the problem at phone interviews, written tests, and face-to-face interviews, keeping this in mind, and give you always have a limited amount of time before going for an interview, It's essential to prepare the right set of questions.

Top 21 Java HashMap Interview Questions and Answers

The java.util.HashMap is one of the workhorses of JDK. Along with ArrayList, it is one of the most used classes from Java's collection framework. There is hardly a real-world Java project, where I haven't seen the use of HashMap. It is an implementation of hash table data structure, and it's not a surprise that HashMap is so useful, as someone has rightly said, "if you could have just one data structure, make it a hash table". The hash table data structure allows you to search for a value in O(1) time if you have a key. In Java, several implementations of hash table data structures exist like Hashtable, ConcurrentHashMap, LinkedHashMap, etc. but HashMap is your general-purpose map.

Top 15 Java 8 Stream and Functional Programming Interview Questions Answers

The JDK 8 release has changed the way we write Java. With new functional programming idioms and a powerful Stream API, most of the new Java code is written in a functional style. This also means that Stream and Functional programming-related questions are increasing on Java interviews. If you are not familiar with Java 8 changes, then it's difficult to crack a Java interview nowadays. Though it's not stated anywhere, most of the companies, particularly Investment banks like Barclays, Citi, and Goldman Sachs, now expect Java developers to know at least Java 8, which is also good, right? Java 19 is already out, and we are looking forward to Java 21 in a couple of months, it makes sense to know at least Java 8 changes.

Top 10 Java Collections interview Questions Answers for Beginners

Hello guys, if you have gone through a couple of Java Interviews then you might know that Java Collections is an important topic. There is hardly any Java interview I have faced, and I have faced many where there are no questions from Collections. This Java Collection Framework interview questions and answers contain questions from popular Java collection classes like HashMap, ArrayList, HashSet, ConcurrentHashMap, and legacy collection classes like Vector and Hashtable. These are the questions that have been asked in real interviews and also allows you to explore these essential classes in more detail which will eventually make you a better Java developer. 

Top 21 Java Inheritance Interview Questions and Answers

Hello Java and Object-Oriented Programmers, Last week I wrote about some good Java OOP concept questions and In this article, I am going to share some frequently asked Inheritance-based Java Interview questions and answers. Inheritance is one of the most important Object-oriented concepts along with Abstraction, Encapsulation, and Polymorphism. Since most popular languages are object-oriented like Java and C++, you will always find a couple of questions from OOP concepts, particularly from Polymorphism and Inheritance. 

Difference between HashMap vs TreeMap vs LinkedHashMap in Java

Hello guys, if you are wondering what is difference between HashMap, TreeMap and LinkedHashMap in Java and  when to use HashMap, TreeMap and LinkedHashMap in Java then you are at the right place. Earlier, I have shared difference between HashSet, TreeSet, and LinkedHashSet and in this article, I will explain the difference between these three common Map implementation HashMsp, TreeMap, and LinkedHashMap. Though all three classes like HashMap, LinkedHashMap and TreeMap are implementation of java.util.Map interface, there is some functionality difference between them. Perhaps most notable difference between them comes from their iteration order. HashMap makes absolute no guarantee about in which order you can iterate their keys, any application depending upon iteration order of HashMap is fragile, because it can change anytime. In fact, in Java 7, iteration order of HashMap is different than Java 6. 

3 Ways to send a HTTP GET and POST request in Java? JDK 11 HttpClient Example tutorial

Hello guys, today's word is of modern web applications and APIs and in this world the ability to communicate with remote servers is an essential skill for Java developers. Whether you need to retrieve data from a web service or send data to a server for processing, mastering the art of making HTTP requests is crucial. If you are a Java developer the you must know how to send HTTP requests and parse HTTP Response to work effectively on different kind of Java web applications. If you don't know then don't worry as In this comprehensive guide, we will walk you through the fundamental concepts and practical techniques for sending HTTP GET and POST requests in Java. Whether you're a beginner looking to learn the basics or an experienced developer seeking to refine your skills, this tutorial will equip you with the knowledge and tools to interact with web services effectively using Java.

Top 20 Java Access Modifier Interview Questions Answers for Beginners

Access modifiers is one of the essential concept in Java and every programmer should be familiar with, and because of its importance, its also a popular topic in Java interviews. Access modifier can be applied to class, method, fields, and variables and as the name suggests they control the access. Like who can access that particular class, method or variable. For example, public modifier provides universal access which means any public class, method or variable is accessible by everyone and everywhere. In other words, you can access a public class both within the package and outside the package. 

Top 20 YAML Interview Questions Answer for Developers and DevOps Engineers

Hello guys, if you are preparing for DevOps Engineer interview then you should also prepare YAML questions as YAML is used extensively in Kubernetes, or creating Helm charts or creating Ansible Playbook and you can expect few questions on YAML on DevOps Engineer Interviews. If you don't know YAML stands for Yet Another Markup Language and its one of the popular language for defining system rules. YAML is used in Spring Integration and most popularly in Ansible for defining Ansible playbook which you can use to install or uninstall application and do other stuff. Because of that reasons YAML has become quite popular and you may be asked about basic questions in YAML if you are going for a Developer or DevOps Interview where YAML skills are required. At the very minimum you should know how to read YAML and how to write YAML, particular declaring list and key-value pair in YAML. It's not a big topic but knowing basic really help during interview.

What is Java Constant and how do you declare it? static + final keyword Example Tutorial

Hello friends, ee are again here with new article that is on Java Constant will give all basics about the topic to our viewers or readers. you are looking for content to understand about Java Constant to have deep knowledge of Java basics then you will definitely learn from this article. The definition of "constant" states that it refers to something with a fixed value. Giving a variable in Java a fixed value that it will hold throughout the course of the program's execution creates a constant. Any variable must be converted into a constant by using the "static" and "final" modifiers in the manner described below: