How to parse String to LocalDate in Java 8 - DateTimeFormatter Example

From Java 8 onward, you are no longer dependent on the buggy and bulky SimpleDateFormat class to parse and format date Strings into real Date object in Java e.g. java.util.Date. You can use the DateTimeFormatter class from java.time package for all your formatting and parsing need. You are also no longer required to use another buggy class java.util.Date if you are doing fresh development, but if you have to support legacy code then you can also easily convert LocalDate and LocalTime to java.util.Date or java.sql.Date. In this tutorial, we will learn about both parsing String to date in Java and formatting Date into String.

10 Free Java 8 Certification Sample Questions - OCAJP8 and OCPJP8 - 1Z0-808 and 1Z09 dumps

If you are preparing for Oracle Java SE 8 Certifications e.g. OCAJP8 and OCJP8, also known as exam 1Z0-808 and 1Z0-809 and looking for some free practice tests then you have come to the right place. In this article, I am going to share some of the best OCAJP 8 and OCPJP 8 mock tests available for free of cost online, so that you can check your speed and accuracy before the real exam. These tests are not just useful for Oracle's Java OCA and OCP certification but also for upgrade exams like OCJP 8 upgrade exams with code 1Z0-810 and 1Z0-813, upgrade to Java SE 8 from Java 6 and prior version. Many of these practice tests are like web simulator where you need to solve a relatively small number of questions within 45 to 60 minutes. The web simulator also includes timer so that you can finish these free mock tests on time.

How to convert Integer to String in Java - Example

This is the second part of String to Integer data type conversion tutorial in Java, in the first part you have learned how to convert String to Integer and in this article, you will learn the opposite i.e. convert from Integer to String. Actually, you can apply all the tricks, which I had told you before about converting long to String, and autoboxing will take care of converting int to Integer in Java. But, if you care for performance and believe in not using auto-boxing when not needed then there are still a couple of ways which directly converts an Integer object to String e.g. Integer.toString() method, which returns a String object and doesn't have any auto-boxing overhead. Let's see a couple of more ways to convert an Integer to String in Java.

5 Things You can Gift to Programmers,Software Developers and Tech Geeks

So, its that time of the year again when you start thinking about gifts for your programmer boyfriend, husband, colleagues or your near dear ones. Even if selecting gifts were not tough, if your friend happened to be a programmer, it becomes slightly tougher. You might have heard that Programmers are aloof, nerd and tech freaks, well, you heard it right. Programmers  prefers to be alone in their own world but they also like gifts and you got it right, they are a nerd so they like books, gadgets, music and something which help them to learn something e.g. a PluralSight membership.

In 2017, gadgets like Apple Watch and Samsung Gear is rocking but that's what everyone is buying so if you want to be a little bit different, chose the one from this list.

3 Books to learn Java Programming from Scratch in 2019 - Best of Lot Must Read

I receive half a dozen emails every day asking about which is the best to learn Java from scratch? Which book should I read in 2019 to learn Java? or Which is the best Java for beginners? When I receive such email, before giving my recommendation I ask two questions, first do you have any programming experience? e.g. Are you coming from C, C++ or Python background? Or you are a fresher with no experience in programming, just a couple of classes on data structure and algorithm and operating system on college. If the guy some prior experience I recommend him the book like Core Java for the Impatient which teaches basics of Java programming language and API and also how to use Java in right way.

10 Examples of Collectors in Java 8 - Learn grouping, partition, joining, and counting with Collectors

As the name suggests, Collectors class is used to collect elements of a Stream into Collection. It acts as a bridge between Stream and Collection and you can use it to convert a Stream into different types of Collections like List, Set, Map. Btw, it not just limited to that, it even provides functionalities to join String, group by, partition by and several other reduction operators to return a meaningful result. It's often used along with collect() method of Stream class which accepts a Collectors. In this article, we'll learn Collectors by following some hands-on examples.

How to Send HTTP Request from Java Program - Example Tutorial

If you are thinking is it possible to send an HTTP request from a Java program and if yes, how to send a simple HTTP GET request in Java, then you have come to the right place. In this article, I'll show you how you can use the HttpURLConnection class from package to send a simple HTTP request in Java. But, first let me answer your first question, is it possible to send HTTP request in Java? Yes, it's possible and you can send any kind of HTTP request e.g. GET, POST, PUT, DELETE, HEAD, or PATCH. The package provides a class called HttpURLConnection, which can be used to send any kind of HTTP or HTTPS request from Java program.

How to Set Specific Java Version for Maven in Windows?

Maven is a great build tool and most of the Java developer uses Maven to build their projects, but like any other tool, there are some intricacies which you need to know while using it. One of them is that Maven uses Java version from the JAVA_HOME environment variable and not the PATH environment variable. If you have multiple JDK installed on your machine and getting an Unsupported major.minor version 51.0 or Unsupported major.minor version 52.0 error while building your project but have right Java version in PATH then you may need to check the JAVA_HOME and update it. If you don't have access to do it then you can still change JAVA_HOME using set command in your local shell and run the Maven's mvn command to build the project