Pad a String with Spaces in Java

Ashok Veer | June 12, 2020 | Be the first to comment!

Since Java 1.5 we can use the method java.lang.String.format(String , object) and use printf like format.
The format string "%1$15s" will do the job. Where 1$ indicates the argument index, s indicates that the argument is a String 15 represent the minimal width of the String. Putting it all together: "%1$15s". read more
read more...

Java 8 Default and static methods in Interfaces

Ashok Veer | May 22, 2020 | | Be the first to comment!

Java 8 Default and static methods in Interfaces
Java 8 is come up with really good features likes Funtional interface, Lambda expression, Stream, static and default method in interface etc.
Before java 8 an interface in java can contain only abstract method so now java 8 allow having default and static methods.

Default methods are allowing developers to add new method with new functionality without affecting the classes that implements these interfaces. 

read more . . .

read more...

Inner classes in java

Ashok Veer | May 21, 2020 | | Be the first to comment!

In java inner class which is defined inside another class is called nested class or non-static inner class. For instantiating the inner class or nested class object we first need to create the outer class object. We can access outer class member’s variables insides of inner class just like normal members variables of class.

We cannot declare static method or static variable inside the non-static inner class. If we try to declare it shows error The field or static variable cannot be declared static in a non-static inner type.  read more


read more...

Static inner class in java

Ashok Veer | May 21, 2020 | Be the first to comment!


In java a static class which is defined inside another outer class is called static nested class or static inner class. A static inner class is nested class which can be accessed without creating the object of the outer class. We can access like static other static members of class.
A static inner class have does not access to the outer class instance variable and methods. Below is syntax of the static nested class. read more

read more...

Functional Interfaces

Ashok Veer | May 18, 2020 | | Be the first to comment!

A functional Interface concept introduced in java 8 with some amazing features. So let’s check it out properties and example.

Functional interface in java is an interface which contains only a single abstract method and can contain any number of default and static methods which do have an implementation. read more . . .

read more...

Java 8 features with examples

Ashok Veer | May 17, 2020 | Be the first to comment!



java 8 features techfloaters
java 8 features techfloaters
Java 8 is long term support (LTS) release in 18 March 2014, in this article I will summarizes the features and enhancements in Java SE 8. There are many packages and symbols are introduced in java 8.

So from Java 8 onwards java also supports functional programming like other languages like Python, Erlang, Haskell etc.  read more..

read more...

Hashtable in java

Ashok Veer | May 15, 2020 | | | Be the first to comment!
Hashtable in java

Java Hashtable class is available since jdk1.0 which is oldest class in java present in java.util package. Java Hashtable internally contains buckets where the key/value pairs are stored in buckets.

A Hashtable class is an array of a list structure. Each list is known as a bucket. The position of the bucket is identified by calling the hashcode() method.
read more..
read more...

Best Way to Iterate Any Map in java

Ashok Veer | May 10, 2020 | | | Be the first to comment!

Best Way to Iterate Any Map in java


Best way to iterate map in java- techfloaters

Iterating over Map in java there are basically 4 different ways in this article we will look each and every one by one with example. Also we will use Java 8 forEach() method for iterating all the Map interface child class.


read more...

Treemap vs Hashmap

Ashok Veer | May 09, 2020 | | Be the first to comment!

Treemap vs Hashmap

In this topics we are discussing the very interesting topics about difference between

HashMap and TreeMap. Basically both directly or indirectly implements Map interface so some of the functionality is common in both. Still there is some major differences based upon that we can use any one of them in our project.

read more...

TreeMap in java

Ashok Veer | May 09, 2020 | | | Be the first to comment!



The TreeMap is sorted according to the natural ordering of its keys, or by a Comparator provided at map creation time, depending on which constructor is used.
Java TreeMap is a part of collection since jdk 1.2 versions and available in java.util package. TreeMap implements the Map interface and extends AbstractMap class. TreeMap stores data in key & value pairs. read more...


read more...

HashMap in java

Ashok Veer | May 06, 2020 | | | Be the first to comment!


HashMap uses Hashing technique for storing key and value pair in java.
The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.


Java HashMap is a part of collection since jdk 1.2 versions. HashMap implements the Map interface and extends AbstractMap class. HashMap stores data in key & value pairs.  



read more...

TreeSet Class in Java with example

Ashok Veer | May 03, 2020 | | | | Be the first to comment!
TreeSet Class in Java with example

Java TreeSet class which implements NavigableSet interface which is child interface of SortedSet interface. Objects in TreeSet class are stored in sorted ascending order.
TreeSet is similar to HashSet except that it sorts the elements in the ascending order while HashSet doesn’t maintain any insertion or ascending order.
read more...

LinkedHashSet in java

Ashok Veer | May 01, 2020 | | | Be the first to comment!

Java LinkedhashSet class is collection class which implements Set interface. HashSet does not maintains insertion order but LinkedHashSet maintains insertion order of object also LinkedHashSet class is non-synchronized. 
read more ...
read more...

HashSet in java

Ashok Veer | April 30, 2020 | | | | Be the first to comment!

Java HashSet is an collection class which implements Set interface. It is an    un-ordered collection means insertion order is not followed of object in which duplicate value are not allowed. read more...

read more...

List in Java

Ashok Veer | April 29, 2020 | | Be the first to comment!

Java List interface is an ordered collection which follows the insertion order of the element. The user of this interface has precise control over where in the list each element is inserted. We can access the element by their integer index and search for element in the List. read more...

read more...

Vector class in java

Ashok Veer | April 28, 2020 | | | | Be the first to comment!


Vector class is synchronized in nature that’s why whatever operations we perform on vectors. Vector class automatically applies a lock to that operation.

Vector class implements List interface so vector class is also growable in nature which internally resizes array when the elements gets added or removed. 


read more...

Linked List in Java

Ashok Veer | April 26, 2020 | | | | Be the first to comment!

Linked List in Java

LinkedList in java is linear data structures in which element are stored in the different locations and element that are stored in the different location of memory are called as noderead more ... 
read more...

Beginning of java

Ashok Veer | April 25, 2020 | | Be the first to comment!
Beginning of java from techfloaters

Initially, James Gosling other team members started to develop the project in C++, but they faced many problems in C++ compiler regarding with different platform. 

So that time, James Gosling started working on a new language called Oak  which was later in 1995 renamed as Java.. read more..
read more...

How ArrayList works internally in java

Ashok Veer | April 24, 2020 | Be the first to comment!


ArrayList internally uses array data structure and ArrayList grows dynamically when the element are added in the ArrayList as it is create the new array with size greater by its original array capacity….  read more..

read more...

Java Collections - ArrayList

Ashok Veer | April 23, 2020 | | | Be the first to comment!


ArrayList internally uses array data structure and ArrayList is resizable and growable array in nature which implements the List interface... read more...

read more...

Types of iterator In collections

Ashok Veer | April 19, 2020 | | | | | Be the first to comment!


In Java programming language for fetching element one by one from the group of element there are 4 iterator are available which can iterate array, all collection, Map.   So iteration is the basic operation which is required in almost every java project.
read more.....
read more...

Collections in Java

Ashok Veer | April 18, 2020 | | | | Be the first to comment!
Java Collections


Collection means collecting the different data objects in single unit is called collection.
In Java collection framework provided in the java.util package which is introduced in the JDK 1.2 versions.....read more...
read more...
 
Copyright © 2019 techfloaters • All Rights Reserved.
Template Design by Ashok Veer ( veersoft solution)