Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Sunday, 7 April 2019

WHAT IS NEW IN JAVA 12 ?

Yes, you read right. JDK 12 was released on March 19, 2019.

This post of what's going to become Java 12, and, obviously, this post can expand and alter over time, till the event of Java twelve is frozen probably at the end of 2018.
I am about to update this post once a brand new feature (JEP) is targeted for JDK twelve, or once there's a very important update on the already targeted JEP.

 Among others, Java 12 includes a number of new features, such as:
  • JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
  • JEP 230: Microbenchmark Suite
  • JEP 325: Switch Expressions 
  • JEP 334: JVM Constants API
  • JEP 340: One AArch64 Port, Not Two
  • JEP 341: Default CDS Archives
  • JEP 344: Abortable Mixed Collections for G1
  • JEP 346: Promptly Return Unused Committed Memory from G1


JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
It is enforced and supported by RedHat for aarch64 and amd64, Shenandoah dustman, represented during this paper, provides foreseeable and short Gc pauses freelance of the heap size.

JEP 230: Microbenchmark Suite:
Away, and a collection of microbenchmarks, to simply take a look at the performance of JDK, supported Java Microbenchmark Harness (JMH) are additional to JDK ASCII text file.

JEP 325: Switch Expressions 

There are two main changes to switch in Java 12:


  1. Introduction of case L -> syntax that removes the need for break statements, because only the statements next to -> is executed.
  2. The switch can be an expression, so it can have a value, or it can return a value.


JEP 334: JVM Constants API

Define a family of value-based symbolic reference (JVMS 5.1) types, in the new package java.lang.invoke.constant, capable of describing each kind of loadable constant. A symbolic reference describes a loadable constant in purely nominal form, separate from class loading or accessibility context. Some classes can act as their own symbolic references (e.g., String); for linkable constants, we define a family of symbolic reference types (ClassDesc, MethodTypeDesc, MethodHandleDesc, and DynamicConstantDesc) that contain the nominal information to describe these constants.



JEP 340: One AArch64 Port, Not Two

There are two different set of sources, thus ports, targeting ARM 64-bit in the JDK. One is contributed by Oracle, arm64 (hotspot/cpu/arm), and the other is aarch64 (hotspot/cpu/aarch64). This JEP removes arm64, thus all source code used with #ifdefs under hotspot/cpu/arm will be removed and 64-bit ARM build will default to aarch64. hotspot/cpu/arm will still provide the 32-bit ARM port

JEP 341: Default CDS Archives
Class Data-Sharing (CDS) is a feature to reduce startup time and benefit from memory sharing. However, if you do not install the JRE with the installer, the CDS archive is not generated by default and java  -Xshare:dump has to be run manually.
This can be observed in JDK 11. If you install the JDK 11 GA Release from http://jdk.java.net/11/ ,  lib/server folder does not contain the CDS archive, classes.jsa file. If you run java -Xshare:dump, it will be generated.
With this JEP, CDS archive will be generated by default.

JEP 344: Abortable Mixed Collections for G1
In order to satisfy user equipped pause time target, this JEP makes the G1 garbage collector abort the garbage collection method, by splitting the set of to-be garbage collected regions (mixed collection set) into obligatory and optional elements, and abort the garbage assortment of optional half if pause time target won't be reached otherwise.

JEP 346: Promptly Return Unused Committed Memory from G1
This JEP makes the G1 Garbage Collector return the garbage collected memory areas to the operating system after a period of low application activity. Currently G1 was returning the memory to operating system only after a full GC (or a concurrent cycle) which it avoids, so in effect it was probably not returning the garbage collected memory to operating system at all.

Monday, 25 September 2017

What is new in Java 9?

Java 9 is the evolutionary upgrade over its previous version 8 ( including every procedural update ). It's not like a major “groundbreaking” update like 7th but if you could use the “linking of the modules” then it's good for you.Here is some information about it (Java Platform, Standard Edition ) and you can dig out some more use out of this update.
Java 9 has several changes and it would be an extremely long answer if I were to list all of them.

However, there are some changes, which will impact how you program in Java 9. I list some of them below. However, the description will generally be short, as you can research most of them if you want.

1.The Process API changes

If you’ve ever tried accessing native processes running on the system, you’d probably know that Java didn’t use to be good at this. You would have to resort to C++ or C to manage the processes. With Java 9, you’d hardly ever use native code to manage processes.

2.Support for HTTP/2

With this, we finally let go of the legacy class Http URLConnection. It had several problems, however, the one which troubled the most was that used outdated technology based on protocols like FTP and gopher which are no longer in use.

3.Better Stack Traces

Nothing much to say here, just that it is a lot more organized than before. Also, you have the new StackWalker class, with which you can navigate your stack traces through the code, without String Manipulations.

4.Better Javadocs

This is one of my favorites. The Javadocs finally get a search bar, that means I don’t have to use Google to visit the documentation of the class.

5.Supports Unicode 8

Unicode 7 is the latest version of Unicode.

6.Modularity

This can’t be explained very simply, to be honest. It basically “divides the JDK into a set of modules that can be combined at compile time, build time, and run time into a variety of configurations”. To be honest, even I don’t understand it completely.

7.Better String Concatenations

Right now, if you do something like ”A” + “B”, in the bytecode, you have a StringBuffer. While this is a good option, it still has performance issues. Java 9 attempts to fix that.

8.JShell

This is what got most of us excited. No need to make classes, typing code directly into the command prompt. Java has finally got REPL.

9.Compile time improvements

Classes will tend to compile a lot quicker.

10.Javafx improvements

I haven’t actually tried this yet, but several UI Controls and the CSS API have seen a major upgrade.

11.Applets are finally depreciated

This made me happy the most. Finally can schools stop teaching something which has absolutely no future.

12.Parser API for Nashorn

Self explanatory.

13.Compact Strings

“Improve the space efficiency of the String class and related classes while maintaining performance in most scenarios and preserving full compatibility for all related Java and native interfaces.”

14.Project Coin

You can longer use only `_` as a variable name. This used to give a warning in Java 8, but generates an error in Java 9

Top 10 Programming Languages in 2017

Programming is something vast and rather individual as each developer chooses tools that are most convenient for them. However, certain languages, platforms, and frameworks have claimed themselves as one of the easiest and most efficient to use. Thus we have collected for you top-10 programming languages loved by developers nowadays. Which one is your favorite?

1.Python

Python is a dynamic and general-purpose language that emphasizes code readability and enables developers to use fewer lines of code (in comparison with Java or C++).

                         
It supports multiple programming paradigms and has a large standard library.
Developers love this language for clear syntax, good OOP support and great shortcuts.


2.C

C is a general-purpose imperative language that supports structured programming, recursion, and lexical variable scope. It is designed to encourage cross-platform programming and is available on many platforms.


This language is valued for being clear, providing access to hardware and making it possible to create tiny binaries.


3. Java


Java is one the leading choices among developers all over the world. This language is object-oriented and class-based and follows the “WORA” principle: write once, run anywhere.


People love Java for its concurrency (comparing it to be better than Python, for example), great variety of libraries and steadily good performance. The community is huge as well, meaning Java fans can always get a lot of support.

4.C++

This language is compiled, imperative and program-oriented and allows low-level memory manipulation. C++ influenced a number of other languages, such as C# or Java and is used for a variety of purposes.

Its key features that make it stand out are strong, static type system (making it possible to catch more errors within a compile time), ability to use it in a few programming styles, good performance, and expressiveness.


5.C#

C Sharp has seen an increase in popularity over the last year. It is an object-oriented and multi-paradigm language that encompasses many disciplines. C# was developed by Microsoft and is designated for the Common Language Infrastructure.


Though it is not so widespread as Java or Python, C# has its fans who appreciate the lack of headers, macros and templates, the presence of LINQ and anonymous types.


6.R

This is an open source language for statistical computing and it is very popular among data miners and statisticians. This language is a GNU package.


The R pros include its package ecosystem and its vastness and all the charting benefits.

7. JavaScript

JS is an object-based and dynamic language and is one of the core technologies of WWW content production. Even though some people tend to think Java and JS are the same (or at least, very similar) languages, JavaScript was influenced mostly by Self and Scheme.





JavaScript is seeing a rise in popularity and is included in hottest web development trends for the year 2017.

8. PHP

It’s a server-side and general-purpose language designed for web development. PHP is considered rather easy to learn and is often chosen by junior developers.

As well developers love that it’s portable, has a lot of high-quality solutions for an array of web problems and has a lot of frameworks.

9.Go

Go was created at Google and is an open-source language. It’s compiled and has such features as garbage collection, memory safety and limited structural typing.

It is really a good choice if you work with network applications and web servers. Go also consistently behaves across platforms, which is also a good feature.

10.Swift


Swift is a multi-paradigm language developed by Apple and is one of the top choices among iOS developers. It supports such concepts as late binding, extensible programming and dynamic dispatch.

Even though Swift is a relatively new language, it also saw rise in popularity in 2017 and overall looks quite promising.