Posts

Showing posts with the label String handling in java

Strings Handling :String functions in java ,string operations in java

  String handling in java: (OR) String manipulations in java: Strings represents a sequence of immutable characters. Or string is an object that represents a sequence of characters or char values. The  java.lang. String  class is used to create a Java string object. --->The length of the String object is fixed.  --->String object is immutable and cannot be modified.  --->Strings are used for storing text. How many ways we can create the string object? There are two ways to create a String object: 1.Using string literal 2.Using new keyword Strings may  be declared and created as follows: 1. By string literal  : Java String literal is created by using double quotes. For Example: String s="HelloWorld";   2. By new keyword  : Java String is created by using a keyword "new". For example: String stringName; StringName=new String("HelloWorld"); Or We can combine above statements.  String s=new String("...