How to convert Java 8 Stream to Array or ArrayList - Example Tutorial

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 e.g. 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 array of T. On the other hand, the overloaded version of toArray(IntFunction[] generator) returns an array containing the elements of this stream, using the provided generator function to allocate the returned array, as well as any additional arrays that might be required for a partitioned execution or for resizing.

SOAP and RESTful - Best Books to Learn Web Service in Java

If you are a Java developer and want to learn how to develop Web Services in Java, both SOAP and RESTful, but confused on where to start, then you have come to the right place. In this article, I am going to share some of the best books to learn about both SOAP and RESTful web services in Java. If you are not familiar with Web Services, it's way to expose the services provided by your application to other developers and application. For example, if your system provides weather information then the user can go and check whether manually by looking at the Web GUI built using HTML, CSS, and JavaScript, but by exposing the same information using Web services, you allow a programmer to display as they want.   A programmer can invoke your web service from a smartphone application and show weather related information in a weather app. The web service really makes your services more accessible and opens a new way to show the information to different users.

How to add JAR file in Eclipse Project Build path - External dependency

In this Java Eclipse tutorial, I will show you two ways to add external JAR files in Eclipse Java projects. Many times we need to use external JAR files in our Java application for different needs e.g. for general purpose you may use Google Guava or Apache Commons. If you are using Spring or Hibernate framework then you need their JAR files as well. In order to use any third-party library or framework, we have to add their JAR files in the classpath, to compile and run our Java programs. Since Eclipse is the most popular IDE for developing Java applications, it's important to know how you can add external JARs into your Java project's build path. For example, suppose, you have downloaded Apache commons JAR file from the internet and wants to add that file to your Java project. In order to use classes and methods from that library, your project must reference those and this is what we will learn here.

Top 10 OCAJP and OCPJP Exam Simulators for Java Certifications

There is no doubt that exam simulators play an important role in preparing for any Java certification e.g. OCAJP, OCPJP, OCEJWCD,   OCMJEA exams. In fact, they are one of the most important pillars because choosing a good exam simulator with a good book is generally the success mantra of many Java certification aspirants. The exam simulators prepare you well for exams by presenting the the level of questions you can expect in real exams. They provide the must needed practice in exam like environment to gauge your speed and accuracy. I have personally seen difference of 30% in score between people who do a lot of mock exams and who just goes without practicing mock exams. Candidates makes more mistakes when they first took exams and by participating in mock tests, you train your mind to do less mistakes. They also help you to better handle the time pressure of real exam.

2 Best Books to Learn Hibernate for Java Developers

Hibernate is the leading ORM (Object to relational) framework in Java world used to implement persistence layer of enterprise Java applications. It was one of the first Java frameworks on ORM persistence and exists even before the Java Persistence API was introduced. It has since then implement JPA interfaces and you can use Hibernate as one of the JPA implementation. In fact, it is one of the most popular JPA implementation in Java world. I receive a lot of email about books and tutorial to learn Hibernate, especially from intermediate Java developers, who has a couple of years of experience in Java but new to Hibernate. It is also a very useful skill to have on your resume because they are a lot of companies who are using Spring and Hibernate to developer enterprise Java application. So if you are looking for a job in Java world, particularly as Java web development role learning both Spring and Hibernate can help you to get your dream job.

12 Advanced Java programming books for Experienced developers - Part 2

This is the second part of 12 must read advance Java programming books for intermediate and experienced Java programmers. In the first part, I have shared books to learn and master concurrency, performance, design patterns, and Java collection framework. In this part, I will talk about more advanced concepts e.g. security, Java 8, best practices etc. As an experienced Java developer, a lot is expected from you. Junior developers look at you for guidance and project managers look at you to solve problems and bail them out at key junctures. If you don't have solid knowledge of the various aspect of software development, testing, deployment, and documentation, you won't be able to do your job properly and rise in your career.