Tag Archives: Java Class

JAVA Assignments – Strings in JAVA 10th Class notes – ICSE JAVA Notes

JAVA Assignments – Strings in JAVA 10th Class notes – ICSE JAVA Notes Important Questions What is the difference between a String object and a String Buffer object ? What do the following functions return for : String x = “Hello”; String y= “World”; System.out.println(x+y); System.out.println(x.length()); System.out.println(x.charAt(3)); System.out.println(x.equals(y)); Differentiate between toLowerCase() and toUpperCase() methods ? […]

DIFFERENCE BETWEEN STRING AND STRING BUFFER in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

DIFFERENCE BETWEEN STRING AND STRING BUFFER in JAVA – JAVA 10th Class notes – ICSE JAVA Notes     DIFFERENCE BETWEEN STRING AND STRING BUFFER :   String String Buffer String type Object has fixed Length String Buffer type object has provisions to change the length. New object is created to produce the change. Change […]

setLength(n)in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

setLength(n)in JAVA – JAVA 10th Class notes – ICSE JAVA Notes setLength(n) : setLength(n) function allows you to set the length of a string buffer variable up to the specified range. If a string to be stored has more than the specified length then the characters exceeding the length are truncated, or otherwise stores NULL […]

insert(offset, x) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

insert(offset, x) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes insert(offset, x) : insert(offset, x) function allows you to insert a String at the specified index into the another String. Syntax : str1.insert(index, str2); Example : StringBuffer str1 = new StringBuffer(“COMPUTER FUN”); StringBuffer str2 = new StringBuffer(“ IS”); str1.insert(8,str2);   Output : […]

append(x) in JAVA – JAVA 10th Class notes – ICSE JAVA Note

append(x) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes append(x ) : append(x ) function lets you add String x at the end of the other String. Syntax : str1.append(str2); Example : StringBuffer str1 = new StringBuffer(“COMPUTER”); StringBuffer str2 = new StringBuffer(“ APPLICATION”); str1.append(str2);   Output : COMPUTER APPLICATION   /* Program […]

STRING BUFFER FUNCTIONS in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

STRING BUFFER FUNCTIONS in  JAVA – JAVA 10th Class notes – ICSE JAVA Notes STRING BUFFER FUNCTIONS : Some of the StringBuffer functions are as follows :   S.No. String Buffer Functions append(x ) insert(offset, x) setCharAt(index,c) delete(beg, end) setLength(n) reverse( )  

String Buffer in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

String Buffer in  JAVA – JAVA 10th Class notes – ICSE JAVA Notes   STRING BUFFER : A StringBuffer object provides a string whose value can change. The String Buffer class is a part of the java.lang package. It is an alternative to the String class. A string buffer contains a memory block called a […]

trim in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

trim in JAVA – JAVA 10th Class notes – ICSE JAVA Notes trim( ) : trim( ) function is used to remove the blank spaces form either side of the string. The Blank spaces that are available in between the words, remain unchanged.   Syntax : String var= str.trim();   Example : String str= “  […]

substring(int beginindex, int endindex) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

substring(int beginindex, int endindex) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes substring(int beginindex, int endindex) : substring(int beginindex, int endindex) function is used to extract a part of the string. This extracted part of the main string is known as the Substring. Syntax : String var=str.substring(index); Example : String str= “COMPUTER”; […]

replace( char oldch, char newch) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

replace( char oldch, char newch)  in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   replace( char oldch, char newch) : replace( char oldch, char newch) function replaces all the occurrences of the specified old character with the new character within the given String.   Syntax : String res=str.replace (oldch, newch);   Example : […]