1. Simple Java programs to know what output will be...
class aaa
{
private int a;
public void sam()
{
System.out.println(a);
}
}
class psp
{
public static void main(String aa[])
{
aaa x;
x=new aaa();
x.aaa();
}
}
Output:- 0 because, Java is safe language and no possibility
of garbage value.
----------------------------------------------------------------------------------
class aaa
{
private int a;
public void sam()
{
System.out.println(a);
}
}
class psp
{
public static void main(String aa[])
{
aaa x;
x=new aaa();
x.aaa();
}
}
Output:- 0 because, Java is safe language and no possibility
of garbage value.
----------------------------------------------------------------------------------
No comments:
Post a Comment