Categories
Core JAVA

String,String Buffer and String Builder in JAVA

String, String Buffer and String Builder in JAVA:- String:- String is predefined final class present in the default package. As string is a final class it cannot be inherited. String is purely immutable(contents cannot be changed) in nature that contents of the string cannot be changed once it assigns. How string is immutable? PROGRAM:- class […]

Categories
C

String in C

String in C:- A string in C is a character array terminated with a null character. All the string are character array but all the character array is not a string. main() {             char p[]={‘a’,’b’,’c’,’d’};             char q[]={‘a’,’b’,’c’,’d’,’\0’}; } Here p is a character array and q is a string. Anything is written within […]