P
Proton Projects - Moin
Hi all,
I have doubt regarding the String literal...
I come to know from java documentation
String str = "abc"; is equivalent to:
char data[] = {'a', 'b', 'c'};
String str = new String(data);
Whether , String str = "abc" is compiler specific code...so whenever
the compile encouter this code..it automatically converts to char
data[] = {'a', 'b', 'c'};
String str = new String(data);
Can i have my own class to have this function...say i have class
called Hello,
So that Hello h = "Hi"
can it be able to convert it
char data[] = {'H', '1'};
Hello h = new Hello(data);
How can do this programmatically
Regards
Moin
I have doubt regarding the String literal...
I come to know from java documentation
String str = "abc"; is equivalent to:
char data[] = {'a', 'b', 'c'};
String str = new String(data);
Whether , String str = "abc" is compiler specific code...so whenever
the compile encouter this code..it automatically converts to char
data[] = {'a', 'b', 'c'};
String str = new String(data);
Can i have my own class to have this function...say i have class
called Hello,
So that Hello h = "Hi"
can it be able to convert it
char data[] = {'H', '1'};
Hello h = new Hello(data);
How can do this programmatically
Regards
Moin