Hello guys, just wanna ask help from you again. I just reviewed my notes and tried to run the code, I successfully debugged it but when I ran the code it says

java.lang.NoSuchMethodError: main
Exception in thread "main"
Process completed.

I just don't know what to do. =/ here's my code:

import java.io.*;
public class Test6
{
	public static BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
	{
	int choice=0;
	try{
	System.out.println("Pick a mystery fruit \nEnter 1,2,or3");
	choice=Integer.parseInt(input.readLine());
	}
	catch(IOException ioe) {}
	
	if(choice==1){
	System.out.println("You picked a Banana");
	}else if(choice==2){
	System.out.println("You picked an Apple");
	}else if(choice==3){
	System.out.println("You picked an Orange");	
	}else{
	System.out.println("Choice not recognize");
	}
  }
}
Re: Else If statement again. ~.~ 80 80

You missing main method. So either implement main method in your code or create another class with main method that will make use of yout Test6 class

Re: Else If statement again. ~.~ 80 80

yay.. my fault.. lol.. I forgot to input something.. thank you sir! =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.