Java String Example Program

Chapter: Data Types Last Updated: 19-06-2016 18:23:08 UTC

Program:

            /* ............... START ............... */
                
public class JavaStringExample {

	public static void main(String args[]) {
		String string = "Welcome To JavaScan.com";
		System.out.println(string);
	}
}
                /* ............... END ............... */
        

Output

Welcome To JavaScan.com

Notes:

  • The String class is immutable (constant).
  • Strings in java, once created and initialized, cannot be changed.

Tags

Java String Example, Data Types

Similar Programs Chapter Last Updated
Primitive Datatypes In Java Example Data Types 17-06-2016
Enum In Java Example Data Types 28-04-2016
Java Short Example Program Data Types 10-06-2016
Java Long Example Program Data Types 15-07-2016
Java Int Example Program Data Types 06-07-2016
Int Array In Java Example Program Data Types 09-06-2016
Java Float Program Example Data Types 28-03-2017
Java Double Example Program Data Types 28-03-2017
Java Char Example Program Data Types 28-03-2017
Java Byte Example Program Data Types 28-03-2017
Java Boolean Example Program Data Types 28-03-2017

1