Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Program won't work, class error

0 votes
asked Dec 7, 2018 by Tim


  import java.util.*;

 //Error is here
public class BATTLE
{
  
public static void main (String[]args)
  {
    
Scanner Name = new Scanner (System.in);
    
System.out.println ("Another trainer is issuing a challenge!");
    
System.out.println ("Zebstrika appeared.");
    
System.out.println ("Which Pokemon do you choose?");
    
System.out.print ("You chose ");
    
String PokemonName = Name.next ();
    
System.out.println ("Itb

1 Answer

–1 vote
answered Dec 7, 2018 by Sivasankar Sivasankar (170 points)

your using online GDB compiler for java stored as a mainfile has main.java. but you give the class name with public modifier get error. Because it get file name Battle.java.

System.out.println ("Itb");

public static void main (String []args)

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...