If in Java , not a statement error -
class box { // instance variables double length ,ipsos ; double width ,mikos ; double height ,platos; // constructors public box ( double side ) { width = side ; height = side ; length = side ; } public box ( double x , double y , double z) { platos = y ; ipsos = z; mikos = x ; } // methods double calculate(double praksi) { return 2 * ( width * height + width * length + height * length ) ; } double volume(double emvadon) { return platos*ipsos*mikos ; } @override public string tostring() { return "volume: " + volume(1) + "\n calculate: " + calculate(1); } public class cube extends box { public cube(double side) { super(side, side, side); if (side<0) { system.out,println("lathos timi);} } } }
in upper code,compiler finds error on : if (side<0) { system.out,println("lathos timi);}
it says : not statement
what wrong? im new @ java programming , 'if' c .
you have comma in println statement. should be:
system.out.println("lathos timi");
Comments
Post a Comment