correct method "get next value"
Posted
by kapec
on Stack Overflow
See other posts from Stack Overflow
or by kapec
Published on 2010-05-06T16:40:19Z
Indexed on
2010/05/06
16:48 UTC
Read the original article
Hit count: 117
java
Hello!! i need your help! this is my code, it not so good as i wander - it is not working. i have not idea anymore.
</code>// need to get next parameter
static double getParametr(){
Scanner scanner = new Scanner(System.in);
param = scanner.nextDouble();
return param;
}
..........
................
if (i==1){
System.out.println("vvedite storoni pryamougolnika: ");
Shape parA = new Rectangle();
parA.a = Shape.getParametr(); --- this is ok
double aa = parA.a;
Shape parB = new Rectangle();
parB.b = Shape.getParametr(); ------ this is no work!!!
double bb = parB.b;
Rectangle rec = new Rectangle(aa, bb);
arrayFigur[i] = rec.area();
}
how fix mistake?
© Stack Overflow or respective owner