You're adding 3 doubles together and assigning it to a String variable. If you add anything to a string however, it automatically gets casted into a string and concatenated.
this should work.
zwembad = "" + Lengte + Breedte + Diepte;
11-21-2004, 04:11 PM
petert17
your code
well check this out
here we go :
import java.lang.String;
public class Zwembad
{
double Lengte;
double Breedte;
double Diepte;
double Inhoud;
you only have to add the "" once, just like in Phaelax example.
11-21-2004, 07:20 PM
petert17
well thats because this are the only thing to change in you're code
in other word System.out.println ("Should be applayed to String type only")
you got it?
that 's why we're taking the String value of your variables
it compil fine