Java-String Concatenation

String Concatenation To join two String objects to form a new, single string you use the + operator, just as you have been doing with the argument to the println() method in the program example thus far. Program Program Source class Javaapp { public static void main(String[] args) { System.out.println(“hajsof”+”java”+”tutorial”); } }

Java-Extracting Character

Extracting Character The charAt( ) method provides the character at the specified index position. The starting value of the index in the case of a string is zero. For example, in the following program, the character at position 3 in the string “hajsof” is ‘s’. Thus, the str1.charAt(3) method will return the character ‘s’. Concat … Read more…

Java-String Concatenation

String Concatenation Java defines one operator for string object such as “+”, it is used to concatenate two string. For example, in the following program, the value of the variable ‘a’ and ‘b’ is being converted to a string that represents this value as a decimal digit character. This is prompted by the fact that it … Read more…