java program...help needed
i m new to java. i need help my program has compiled but when displaying the output it shows 0 everytime if i change the value then also it shows 0.i think it is something related to garbage value. please help me to configure my problem and correct my code. i wrote a program to calculate rectangle area.
class recta
{
int a,b,c;
public recta()
{
int a=1;
int b=2;
int c=3;
}
public int calc()
{
int area;
area=a*b*c;
return area;
}
}
class D
{
public static void main(String args[])
{
recta d=new recta();
d.calc();
System.out.println("arrea is"+d.calc());
}
}