HTML

Top 18 Java Design Pattern Interview Questions Answers for Experienced

Design pattern interview question in Java
Hello guys, if you are preparing for Java interviews and looking for frequently asked design pattern interview questions then you have come to the right place. In the past, I have shared the best courses for Java interviews, and today, I am going to share popular design pattern questions from Java interviews. You can use these questions to both practices and check your knowledge about OOP design patterns. Both OOP and GOF design pattern interview questions are an integral part of any good list of core Java interview questions. Java is a popular Object-oriented programming language and has lots of design patterns and design principles, contributed by many developers and open-source frameworks.

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 a different level 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 interview, written test, 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 5 Object Oriented Analysis and Design Interview Questions for Programmers, Software Engineers

Testing the design skill of a candidate is quite common in programming job interviews. Questions like, how do you design a vending machine or a traffic control system is very popular in object-oriented programming language interviews, like Java and C++. Designing a software System requires good experience and knowledge of tools of object-oriented design and analysis. You should not only be good at OOP fundamentals like Abstraction, Inheritance, Polymorphism, Encapsulation, Coupling, Cohesion, Association, Aggregation, or Composition but also on several crucial object-oriented design principles like SOLID Principles of Object-Oriented Design, which is the building block for writing flexible and maintainable code.

10 Things Java Developer Should Know about Lambda Expression of Java 8

The Lambda expression is one of the most important features of Java 8 which has opened a whole new dimension of programming paradigm in Java. It is the feature which made the Functional Programming possible in Java because now you can pass the code to a function to execute as opposed to an object. You might be a bit surprised but if you look from a developer's point of view, it is nothing but a way to pass your code to a method in Java.

3 Best Books to Learn Java Programming for Beginners

Hello guys, if you want to learn Java from scratch and looking for the best Java books then you have come to the right place. Earlier, I have shared the free Java courses for beginners, and today, I am going to share the best books to learn Java from scratch. There is no doubt that the best book to learn Java for beginners is indeed Head First Java, 2nd Edition. It's interesting, informative, and yet easy to read, which is what a beginner wants. The only drawback of this book is that there is no 3rd Edition available.

Top 50 Java Generics and Collection Interview Questions

Hello guys, if you are preparing for Java interviews and looking for some frequently asked Java generics and Collections interview questions then you have come to the right place. In the past, I have shared 130+ core java questions and online courses for Java interviews and In this article, I am going to share the best Java collection interview questions to crack the interview. You will not only get exposure to frequently asked questions but also learn very useful Java topics that will help you in your day job.  Java Collection and Generic are a very important topic for Java Interviews. They also present some of the hardest questions to a programmer when it comes to interviews, especially Generics.

Can you make an Abstract Class or Method Final in Java?

No, you cannot make an abstract class or method final in Java because the abstract and final are the mutually exclusive concept. An abstract class is incomplete and can only be instantiated by extending a concrete class and implementing all abstract methods, while a final class is considered as complete and cannot be extended further. This means when you make an abstract class final, it cannot be extended hence it cannot be used and that's why the Java compiler throws a compile-time error when you try to make an abstract class final in Java. In short, an abstract class cannot be final in Java, using both abstract and final modifier with a class is illegal in Java. 

How to Join Multiple Strings in Java 8 - String.join() Example

Hello guys, I have been writing about the new features of Java SE 8 for quite some time. Initially, my focus areas on much talked about lambda expressions and streams, but slowly I realized that Java 8 is not just about them, it's much more than that. It has many more new features and API enhancements which will help Java developers in their day-to-day job as much as lambdas and streams. One of such less talked feature is the ability to join multiple String objects into one separated with any delimiter. It has added a class called StringJoiner in the java.util package which we have seen earlier, but it has also added a new method on String class, the join() method, which finally allows you to join Strings in Java.

How to debug Java 8 Stream Pipeline - peek() method Example Tutorial

Hello guys, I have been writing about some important methods from Java SE 8  like map(), flatMap(), collect(), etc from quite some time, and today I'll share my experience with another useful method peek() from java.utill.stream.Stream class. The peek() method of Stream class can be very useful to debug and understand streams in Java 8. You can use the peek() method to see the elements as they flow from one step to another like when you use the filter() method for filtering, you can actually see how filtering is working like lazy evaluation as well as which elements are filtered.

4 Examples of Stream.collect() method in Java 8

Hello guys, you may know that Java 8 brought Stream API which supports a lot of functional programming operations like filtermapflatMap, reduce, and collect. In this article, you will learn about the collect() method. The collect() method of Stream class can be used to accumulate elements of any Stream into a Collection. In Java 8, you will often write code which converts a Collection like a List or Set to Stream and then applies some logic using functional programming methods like the filter, map, flatMap and then converts the result back to the Collection like a ListSetMap, or ConcurrentMap in Java. In this last part, the collect() method of Stream helps. It allows you to accumulate the result into a choice for containers you want like a list, set, or a map.

Top 5 Java 8 Default Methods Interview Questions and Answers

Hello guys, If you are preparing for Java interviews and want to learn about default methods in Java then you have come to the right place. In the last couple of articles, I have to talk about default methods introduced in JDK 8. First, we have learned what is the default method and why it is introduced in Java. Then we have seen the example of how you can use default methods to evolve your interface. After that we have analyzed does Java really supports multiple inheritances now in JDK 8 (see here) and how Java handles the diamond problem that will arise due to default methods.

Top 20 ArrayList Interview Questions and Answers for Java Developers

Hello guys, if you are preparing for Java interviews then you have come to the right place. In the past, I have shared 130+ Java interviews questions and online courses to prepare for Java interviews and In this article, I am going to share some of the good Java interview questions based upon the ArrayList class. I have hardly seen a Java interview without any question from ArrayList, and why not its one of the most popular collection class and every Java developer use it on their day to day work. Another reason for asking a question related to ArrayList is that you can ask a wide variety of questions to really check the breadth and depth of a candidate's knowledge.

java.util.Stream to Array and ArrayList in Java 8 - Tutorial Example

It's relatively easy to convert a Stream to an array in Java 8 by using the toArray() method of java.util.Stream class. By using this method you can convert any type of Stream to a corresponding array like a Stream of Strings can be converted into an array of String, or a Stream of integers can be converted into an array of Integers. The Stream.toArray() method is also overloaded, the one which doesn't take any parameter returns an Object[] which might not be very useful, particularly if you want to convert Stream of T to an array of T.

5 Free SQL Books For Beginners and Experienced - Download PDF or Read Online

There is no doubt that SQL is one of the most essential skills for Programmers, IT professionals, Software Engineers, Quality Analysts, Project Manager, Data Scientist, Database admins, and Business Analysts. I had even mentioned this as one of the top skills in my post about 10 things every programmer should know, if you haven't read that yet, you can read it here, it's completely worth of yours time. Since many Enterprise applications use the relational database at their backend, like Oracle, Microsoft SQL Server, MySQL, it's crucial to learn SQL to work with those applications and use the data stored on those databases.

Top 3 Books to Learn Hibernate for Java Developers - Best of Lot

Hello guys, if you want to learn Hibernate and looking for the best Hibernate books to start with then you have come to the right place. In the past, I have shared the best Hibernate courses and Spring online courses, and today, I am going to share the best books to learn Hibernate for beginners. These books have been created by Hibernate experts like Gavin King, creator of Hibernate himself and it will help you to master this essential Java framework for full-stack developers. Hibernate is the leading ORM (Object to relational) framework in the Java world used to implement the persistence layer of enterprise Java applications.

Top 6 books to learn Java Virtual Machine, Garbage Collection, and Performance in-depth

In the last couple of years, I have seen a trend of many Java developers wants to learn more and more about JVM internals and how Java Virtual Machine and its different component works. This trend was not so strong in the last decade, but with more and more focus on concurrency, performance, and scalability, Java developer is exploring JVM internals, Garbage collection, and Performance tuning in more detail. Unfortunately, there are not many good books to learn about JVM internals and its different components, but fortunately, we have an excellent Java Virtual Machine specification to learn fundamentals. It is also the most up-to-date reference because Java and JVM are kept changing, especially after Java 10.

5 Essential Spring Boot Annotations Every Java Developer Should Learn

Annotations have completely changed the way you write Java code. It's now impossible to write any Java code without using annotations but that's for good. They provide a lot of value and that's why it's important for a Java developer to get familiar with essential annotations of the framework he or she is using. When I think about Java, some of the essential annotations which come in our mind are @Override, @SuppressWarning, and @Deprecated. Similarly, if you are using the Spring Boot framework, an extension of the Spring framework which aims to simplify the Java development with Spring, you will often end up using a couple of annotations like @SpringBootApplication or @EnableAutoConfiguration.

How to Increasing Heap Size in Java application or JVM?

Hello guys, if you are wondering how to change the heap size of the heap space of your Java application then you have come to the right place. In this article, I am going to tell you how to increase Java heap space so that your JVM will not crash using OutOfmemoryError. We have already seen how to increase heap memory in Maven and ANT and now we will learn how to increase heap size in Java, Eclipse, Tomcat, and WebSphere Server in a series of articles. Since all these are Java applications, once you know how to change heap space in Java, you can do that in any Java application, provided you know the right place, which is what we will see in this article.

Difference between a List and ArrayList Reference Variable in Java?

Someone who is just starting with Java programming language often has doubt about how we are storing an ArrayList object in List variable, what is the difference between List and ArrayList? Or why not just save the ArrayList object in ArrayList variable just like we do for String, int, and other data types. Well, the main difference between List and ArrayList is that List is an interface while ArrayList is a class. Most importantly, it implements the List interface, which also means that ArrayList is a subtype of List interface. In Java or any object-oriented language, the supertype of a variable can store an object of subtype.

Top 10 Books Every Programmer Should Read

There is a saying that if you learn from your mistakes, you will only going to learn few things, but if you learn from other's mistake, you can learn a lot of things in a short time, and what could be a better way to learn from someone's experience then reading books. Programming as a career is about constant learning and updating yourself, but unfortunately, there is no right way to begin. School and Colleges are far behind when it comes to real-world programming, and every Computer Science graduate is not lucky to work in a company that is great in training. The other viable option is to read books, join online courses, and follow advice from the great programmer and authors who are gone on that path, and learning from the book is the most tried and trusted way of all of them.

10 Books and Courses to Prepare Technical Programming/Coding Job Interviews

If you are preparing for a technical interview in the software development sector and looking for some great books to boost your preparation, then you have come to the right place. In the past, I have hared some of the best online courses to prepare coding interviews. In this article, I am going to share some of the best programming/coding interview books to prepare well for any software development jobs. These books are enough to crack even the toughest of the job interviews at GoogleAmazon, or Microsoft. They provide excellent coverage of all essential topics for programming job interviews like data structure and algorithms, system design, algorithm design, computer science fundamentals, SQL, Linux, Java, Networking, etc.

BufferedReader.lines() + Stream Examples in Java 8

Hello guy, in this article, I am going to tell you about a useful method from BufferedReader class, the lines() method which can be used to read a file line by line. The BufferedReader.lines() is kind of interesting, letting you turn a BufferedReader into a java.util.Stream in Java 8. This is a very powerful thing as it allows you to tread a file as a stream and then you can apply all sorts of Stream methods like map, count, flatMap, filter, distinct, etc to apply powerful transformation. We will actually see examples of those in this article by finding out the longest line from the file and printing each line of the file.

Difference between Abstract class and Interface in Java 8

Ever since JDK 8 has allowed concrete (non-abstract) methods on the interface like default and static methods, many of my readers have asked me how should they answer the classical abstract class vs interface questions. Earlier, an interface cannot have any concrete methods and that was the main difference between abstract class and interface but now that is not the case. In this post, I'll revisit this hugely popular Java interview question in light of Java 8 changes. This is also a popular Java interview question and knowing the difference will help you to answer this question on a real interview.