VStanced/mods
Submit a mod
Mods Guides Forum Submit a mod Log in Register

Forum

Questions, builds, help and the odd argument. The mods and guides are out front.

problem with java
 
Notifications
Clear all

problem with java

1 Posts
1 Users
0 Reactions
2,729 Views
pixi
 pixi
(@pixi_104)
Estimable Member
Joined: 17 years ago
Posts: 103
Topic starter   [#1739]

public class Zival{
private String ime; //Spremenljivka spol, ki vsebuje podatek katerega spola je zival
private int starost; //Spremenljivka starost, ki predstavlja starost v letih
public Zival () {}//Privzeti konstruktor
public Zival (String i, int st) {//Konstruktor z parametri
ime=i;
starost=st;
}
public String getIme(){//Metoda getIme
return ime;
}
public int getStarost(){//Metoda getStarost
return starost;
}
public void setIme(String i){//Metoda setIme
ime=i;
}
public void setStarost (int st){//Metoda setStarost
starost=st;
}
public String toString() {//Metoda toString
return "Zivali je ime"+ime+"in je stara"+starost;
}
public static void main (String[]args) {//Metoda Main
Zival z1=new Zival( bella ,2);
System.out.println( "Ime:" + z1.getIme());
System.out.println("Starost: " + z1.getStarost());
z1.setIme( floki );
z1.setStarost(7);
System.out.println (z1.toString ());
}
}

this is error report:

C:\Documents and Settings\Shaggx\My Documents\Zival.java:25: cannot find symbol
symbol : variable bella
location: class Zival
Zival z1=new Zival( bella ,2);
^
C:\Documents and Settings\Shaggx\My Documents\Zival.java:28: cannot find symbol
symbol : variable floki
location: class Zival
z1.setIme( floki );
^
2 errors

Tool completed with exit code 1



   
Quote
Share: