I am a freshie in java
I have some boubts in this code..
what is the static void f (Letter y)?why is it needed?
what happenes when we call f(x)?
one more question its not there in this code... what is transient in java??
class Letter
{
char c;
}
public class PassObject
{
static void f(Letter y)
{
y.c='z';
}
public static void main(String[]args)
{
Letter x= new Letter();
x.c='a';
System.out.println(+x.c+"to X");
f(x);
System.out.println(x.c+"new X");
}
}
2007-03-09
18:01:59
·
2 answers
·
asked by
Database
2
in
Computers & Internet
➔ Programming & Design