So, I'm quite new to Java. I've learned quite a bit for being new. But...of course I don't understand everything.
I have 2 classes. One named "Random" and one name "ananas" (Ananas is French for Pineapple)
Random is my main class...but for some reason my main class (Random) is not detecting ananas.
Here is my script in ananas:
public class ananas {
public String a(String PackageA){
PackageA = "This file shall remain TOP SECRET! The ultimate universal secret code is...'Ananas'";
return PackageA;
}
public String b(String PackageB){
PackageB = "File not created yet";
return PackageB;
}
public String c(String PackageC){
PackageC = "File not created yet";
return PackageC;
}
}
And here is my code in "Random":
import java.util.Scanner;
public class Random {
public static void main(String ars[]){
Scanner input = new Scanner(System.in);
System.out.println("Welcome, Please enter the code: ");
String hey = input.nextLine();
if(hey .equals("The sandman ate my dollar"))
System.out.println("Welcome! Please choose one: A), B), C)");
Scanner input2 = new Scanner(System.in);
String heyy = input2.nextLine();
if(heyy .equals("A)"))
System.out.println("File not created yet");
else if(heyy .equals("B)"))
System.out.println("Flid not created yet");
else if(heyy .equals("C)"))
System.out.println("File not created yet");
else
System.out.println("Access Denied");
I tried to do: "ananas abc = new ananas();"
But even when I go to run my code, it only detects "Random"
Please help?