i have got a problem while i tried to compile console game, Console shows me
Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Pytania.main(Pytania.java:6)
Line 6 is public static void main(String[] args), and i sadly dont see fail :(
I use Eclipse, thanks for answer :)
import java.util.Scanner;
public class Pytania{
public static void main(String[] args){
String Elf = ("Elf");
String Kot = ("Kot");
String Wojownik = ("Wojownik");
String Lucznik = ("Lucznik");
Scanner pisz = new Scanner(System.in);
System.out.println("---------------------------------");
System.out.println("----------RPG--TALES-------------");
System.out.println("------------Part 1---------------");
System.out.println("---------------------------------");
System.out.println(" ");
System.out.println("Pamietaj, pisz poprawnie, inaczej mutanty wysadza gre! :D ");
System.out.println(" ");
System.out.println("Podaj nazwe uzytkownika");
String nazwa = pisz.nextLine();
System.out.println("Witaj " + nazwa + " w nowym symulatorze RPG, nastepnym krokiem bedzie wybranie klasy, wybierz klase z dostepnych ponizej");
System.out.println("Elf, Kot, Wojownik, Lucznik");
String postac = pisz.nextLine();
System.out.println("Gratulacje " + nazwa + ", Wybrales klase " + postac);
if (postac=="Elf"){
return postac = Elf;
}
}
This'll help me a lot, thanks ! :)