ALL


  Why using + to concatenate string in Java loop is not a good option

String concatenation is a common operation in Java programming. It is to concatenate multiple strings into a single string. Java provides a String class which is an immutable class which means the object cannot be mutated once instantiated.Once a String object is instantiated, its properties cannot be changed anymore, so when concatenating strings, it's actually create a new String instance to store the concatenated string values. For example, below is a simple string concatenation example.String s = "abcd";s = s.concat("ef");When this piece of code is executed, a new String instance is create...

10,873 0       JAVA 8 STRING JAVA


  Stream API in Java 8

OverviewIn this lesson on Stream API in Java, we will study how we can put Streams to use to write efficient and much more maintainable code. We will also write code with and without Streams so that we are able to compare the two versions.Before doing all this, we must know how to create a Stream and process it and that is what we will get started with.Introduction to StreamsWe will be starting with creating Streams. Let us get started with the Stream<T> API which enables us to play with Stream processing.Creating StreamsStreams can be created from any source like a Collection or an arra...

3,986 0       DEVELOPMENT TEAM JAVA 8 STREAM API


  Eclipse 4.4 is going to fully support Java 8

Eclipse is the most popular IDE for developing Java applications, but it seems lag behind the Java 8 release a couple of months ago. The current Eclipse is not supporting Java 8 and if you want to run Java 8 programs on it, you need to install a plugin. You can find the plugin at the Eclipse market place. Now Eclipse 4.4 is coming to us on 25th June and the code name for it is Luna.This new version of Eclipse introduces some new features which can ease developer's work, these features including Java 8 support, dark theme and show line number by default, split editors etc. All these features ar...

5,013 0       ECLIPSE JAVA 8 LUNA


  Browse OpenJDK Java source code in Eclipse

Java 8 was recently released, many developers are now trying to extract the source code of Java 8 to find out how the new added features such as Lambda expressions, default method in interfaces, new Time API are implemented. How do you manage to download and browse the source code? Today we are going to show how to extract OpenJDK Java source code to Eclipse.Since OpenJDK is adopting Mercurial as its distributed version control system, you need to install Mercurial on your computer first before you can clone the repository from OpenJDK. You can get more info about the use of Mercurial in OpenJ...

9,730 0       SOURCE CODE ECLIPSE JAVA 8 OPENJDK


  this keyword in Lambda expression in Java 8

Since the release of Java 8, people are excited to see a big feature added to this language which is existing in other languages for a long time -- Lambda expression. The introduction of lambda expression in Java 8 gives people an easy way or a vertical to horizontal way to solve problems. There are many posts on the Internet which shows how to use lambda expression in Java, such as Lambda Quick Start and Java 8 Lambda Expressions Tutorial with Examples. In this post, we will only focus on the this keyword in lambda expression.Unlike anonymous functions, a lambda expression can be considered a...

18,259 2       THIS LAMBDA EXPRESSION JAVA 8