Take the example:
System.out.println("Hello Uni\u03C0");
System.out.println("Hello Esc \\");
this gives something like
Hello Uniπ
Hello Esc \
Is there a way where I can give different values to 03C0 and \ during different iterations in a loop?
for example something like
System.out.format("Hello Esc \%c",'\\');
System.out.format("Hello Esc \%c",'\"');
I know this will give compiler error. I want to know how this can be done.
For example, I would like to print a different unicode character (say from \u0000 to \u00C3) in each iteration of a loop.
For example, I have this function that returns the 4 digit hexadecimal value of an integer:
public static String hexa(int a)
{
int x=a;
String b= String.format("%x",x);
if(b.length() == 1)
{
b="000"+b;
}
if(b.length() == 2)
{
b="00"+b;
}
if(b.length() == 3)
{
b="0"+b;
}
return b;
}
Now I would like to join \u with hexa(i) to get different unicode character for different i