Question:
ICSE 2006 Question 6
Consider the following statement-
"January 26 is celebrated as the Republic Day of India".
Write a program to change 26 to 15, January to August, Republic to Independence
and finally print "August 15 is celebrated as the Independence Day of
India".
Source Code:
public class ICSE2006_6
{
public static void main()throws Exception
{
String s="January 26 is celebrated as the Republic Day of
India";
s=s.replace("January", "August");
s=s.replace("26", "15");
s=s.replace("Republic", "Independence");
System.out.println(s);
}
}
Result:
OUTPUT:
August 15 is celebrated as the Independence Day of India