10. Simple Java programs to know what
output will be.
class aaa
{
private int a;
public void setwattage(int e)
{
w=e;
}
public void printinfo()
{
System.out.println("Wattage is "+w)
}
}
class psp
{
public static void main(String aa[])
{
aaa x;
x=new aaa();
x.setwattage(60);
x.printinfo();
}
}
O/P:- Wattage is 60
-------------------------------------------------------------------------
output will be.
class aaa
{
private int a;
public void setwattage(int e)
{
w=e;
}
public void printinfo()
{
System.out.println("Wattage is "+w)
}
}
class psp
{
public static void main(String aa[])
{
aaa x;
x=new aaa();
x.setwattage(60);
x.printinfo();
}
}
O/P:- Wattage is 60
-------------------------------------------------------------------------
i need a solution to a java real life program...
ReplyDeleteif you are there to help me...
plss mail me.. my id is - kind2all.charmi@gmail.com..
i hope i will get your soon reply...!!!
thank you