posted 22 years ago
take a look at PrintStream class :
public void print(String s)
Print a string. If the argument is null then the string "null" is printed. Otherwise, the string's characters are converted into bytes according to the
platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
s - The String to be printed
public void print(Object obj)
Print an object. The string produced by the String.valueOf(Object) method is translated into bytes according to the platform's default
character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
obj - The Object to be printed
See Also:
Object.toString()
.....
you might be able to accomplish your goal, IF you had been trying to print the value of i or null, instead of invoking the print (Object obj) method ...
... by passing t2 into the println method, you invoke the print(Object obj) method signature.