JAVA Posts

Java String Class

In this blog, we will be discussing about a new concept, Java String. String is a sequence of characters. But in Java, a string is an object that represents a sequence of characters. The java.lang.String class is used to create string object. There are two ways to create a String object: By string literal: Java String literal is created by using double quotes. For Example: String s=“Welcome”; By new keyword: Java String is created by using a keyword “new”. For example: String s=new String (“Welcome”); It creates two objects (in String pool and in heap) and…

Read More