i need to pass a String to a method, but it doesn't work...
public static void main(String[] args) {
System.out.println("Enter a String:");
String abd = Input.readString();
long number = number(String abd);
System.out.println(number);
}
public static long number(String abd){
long num= 0;
if(abd == "AAA"){
num = 100L;
}
if(abd == "BB"){
ean2 = 20L;
}
return ean2;
it prints 0 for the number...and i dont know why! i need to do this with a String...i know it would work with char...is there some way to make this work with String?