import java.util.*; public class Test{ public sta
importjava.util.*;publicclassTest{publicstaticvoidmain(Stringargs[]){RectR=newRect(1,...
import java.util.*;
public class Test{
public static void main(String args[]){
Rect R = new Rect(1,2);
System.out.println(R.area());}
}
class Rect
{
double len;
double wid;
Rect(double len,double wid)
{this.len=len;this.wid=wid;}
double area()
{
return len*wid;
}
} 展开
public class Test{
public static void main(String args[]){
Rect R = new Rect(1,2);
System.out.println(R.area());}
}
class Rect
{
double len;
double wid;
Rect(double len,double wid)
{this.len=len;this.wid=wid;}
double area()
{
return len*wid;
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询