Hi All
Visit
http://www.jchq.net/mockexams/exam1.htm and try question 26.Now I am extending the question(
Java terminology :-) )
class
test {
public static void main(
String args[])
{
String s=new String("Bicycle");
int iBegin=1;
char iEnd=3;
System.out.println(s.substring(iBegin,iEnd));
System.out.println(iEnd);
System.out.println(iBegin + iEnd);
System.out.println("Result With Concatenation of string is " + iEnd +
iBegin);
}
}
Ans:
F:\javasid>java wrap
ic
��
4
Result With Concatenation of string is ��1
Explanation : Above is a nice example of overloding of operator +
and widening of char as int when required otherwise.
Note
the java char value 3 may have distorted look in your browser.compile it and see ur self
Enjoy
Happy Christmas
anjan
[This message has been edited by anjan bhushan (edited December 23, 2000).]
[This message has been edited by anjan bhushan (edited December 23, 2000).]
[This message has been edited by anjan bhushan (edited December 23, 2000).]