Solution 1 - A simple approach is to print the Ascii Value of 'W' directly.
package com.twisters;Solution 2 - You can make use of the overloaded '+' operator to perform character additions.
public class Hello {
public static void main(String args[]){
System.out.println("Hello "+(char)87+"orld");
}
}
package com.twisters;Solution 3 - A cheeky solution is to use double 'U' to form a 'W'
public class Hello {
public static void main(String args[]){
char letter = 'V' + 1;
System.out.println("Hello "+letter+"orld");
}
}
package com.twisters;Congrats to
public class Hello {
public static void main(String args[]){
System.out.println("Hello UUorld");
}
}
1. COMMANDER RV
for getting the right answer.
I'll be putting up a score board soon. Stay tuned for the next puzzle...
System.out.println("Hello "+"\u0077"+"orld");
ReplyDeleteput the statement in main method
nsureshreddy@live.com