Home » Java » Core Java » Page 50

Core Java

APIs To Be Removed from Java 10

In the blog post “JDK 10 Release Candidate Phase“, I looked at the twelve new features that are likely to be part of JDK 10. In this post, I look at some of the APIs that appear likely to be removed in JDK 10 and I look at some APIs proposed to be deprecated in JDK 10. The information in ...

Read More »

Executing Single Java Source Files with One Command

A draft JDK Enhancement Proposal (JEP) was created in late 2017 called “Launch Single-File Source-Code Programs” (its associated JDK issue is JDK-8192920). As its name suggests, this draft JEP aims to “enhance the java launcher to support running a program supplied as a single file of Java source code.” In other words, as the JEP describes, if one had a ...

Read More »

JDK 9: NotNullOrElse Methods Added to Objects Class

JDK 9 added some new methods to the Objects class including two static methods highlighted in this post: requireNonNullElse(T,T) and requireNonNullElseGet​(T obj,Supplier<? extends T> supplier). Both methods make it easier to verify that a given object is not null and to provide an alternative if the provided variable turns out to be null. As such, these methods and the similar ...

Read More »

Java 8: Bastion of Long-term Support

Stephen Colebourne‘s post “Java 9 has six weeks to live” starts, “Java 9 is obsolete in just six weeks.” Colebourne references the Mark Reinhold blog post “Moving Java Forward Faster” and writes, “The new Java release train means that there will be a new release of Java every six months. And when the next release comes out, the previous release ...

Read More »

Top 3 JVM languages Java Programmer Should Learn in 2018

If you are a Java programmer and thinking to learn some more programming language to expand your knowledge and skill, but not sure which programming language to choose then you have come to the right place. In this article, I’ll share 3 JVM languages Java programmers can learn in 2018 and why you should learn them. Being a Polyglot developer ...

Read More »

An Early Look at Features Targeted for Java 11

With JDK 10 about to enter its release candidate phase, it’s interesting to start looking at what will come after that via JDK 11. As of this writing, four JEPs (JDK Enhancement Proposals) have been officially targeted for JDK 11 (with more likely to come). This post summarizes some details about each of the four JEPs currently targeted for JDK ...

Read More »

Comparing files in Java

I am creating a series of video tutorials for PACKT about network programming in Java. There is a whole section about Java NIO. One sample program is to copy a file via raw socket connection from a client to a server. The client reads the file from the disk, and the server saves the bytes as they arrive, to disk. ...

Read More »

Transferring InputStream to OutputStream in JDK 9

One of the minor additions to JDK 9 that can make a sometimes routine task in Java even easier is the addition of the method InputStream.transferTo(OutputStream). This method, as its name suggests, allows for the easy transfer (copy) of bytes from the input stream represented by the object the method is called upon to the output stream provided to that ...

Read More »