No announcement
 

Forming Strings

In Java, Strings are basically sequence of Unicode characters. We can simply form a string by writing:

String message = "Hello World";

Every string is an instance of the String class.

Example:

FormingStringsDemo.java

package com.codingnous.tutorial;

public class FormingStringsDemo {

	public static void main(String[] args) {

		// Declare and initialize a string
		String message = "Hello World!";

		// Print the string
		System.out.println(message);
	}

}

Output
Hello World!