public static void main(String[] args) {
Scanner scan1 = new Scanner(System.in);
int deposit = 0;
String yesno = "";
try
{
System.out.println("Do you have an account already?");
yesno = scan1.next();
if(yesno == "no")
throw new Exception(" ");
System.out.println(yesno);
Calculate();
}
catch (Exception e)
{
System.out.println("HAHAHA");
}
}
public void Calculate()
{
System.out.println("Calculate");
}
The Calculate();
gives an error. How to fix this?
C:\Users\MAC\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:48:
I'm trying to learn new things in java because last time, I was using JavaFX but I don't know how to use the Public void
and how to call them here in Java.