answersLogoWhite

0


Best Answer

Probably you've called some methods not within the main method:

public class Foo{

public static void main(String []args){

// Calling methods here.

}

}

I believe your problem is:

public class Foo{

// Calling methods here. This is wrong.

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you fix 'identifier expected after this token' error in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is token List out various type of token support in java?

Tokens are the smallest unit of Program. There is Five Types of Tokens 1) Reserve Word or Keywords 2) Identifier 3) Literals 4) Operators 5) Separators


In java What is a smallest individual unit in a program?

token


What is parseInt in BufferedReader in java?

parseInt() interprets the next available token as an int.


Java error click for details?

error .click for details


How do you stop the error 'java' is not recognized as an internal?

This error usually means that Java has not been installed on your computer. If you are not prompted to install it, visit the Java website to download it separately.


What type of errors we have in Java programming?

syntax error, Runtime error, Longic error


Where can someone find information on the Java language for no such method error be found?

"No such method" is an error message that may appear when attempting to create a program with Java. Users who understand the Java programming language can find an answer on websites such as Stack Overflow and Crafting Java.


It is not an error not to end a Java file name with the java extension?

If you want to compile a java program the name of that source code must end with extension .java


What are java tokens used for?

In a Java program, all characters are grouped into symbols called tokens. Larger language features are built from the first five categories of tokens (the sixth kind of token is recognized, but is then discarded by the Java compiler from further processing). We must learn how to identify all six kind of tokens that can appear in Java programs. In EBNF we write one simple rule that captures this structure: token


Explain the term identifier in java?

Identifiers are the strings you use in Java source code to identify unique things, such as variables, classes, and methods. Identifiers may be any word beginning with a letter or underscore, and continuing with letters, numbers, and underscores. Identifiers are case sensitive.


What is the similarity between an identifier and a variable?

Answer:- identifier is the name like a, b, c, .... which is used to reference a memory location in a program. +-variable is the actual memory location which can hold values.so 'a' is an identifier to a variable which is memory location located somewhere in memory.Answer:A Variable in Java is something that holds a particular value in a class. For example:public class A { private String name = ""; ......} In the above declaration name is a variable. It would hold the data of type String.An Identifier is nothing but the name that we give for our variables, classes, methods etc. It is nothing but the name with which we identify an entity in Java. For example here A is the identifier for the class, name is the identifier for the variable etc.


What is the way to get rid of Java lang no class deffound error?

To get rid of the Java lang no class deffound error, one must add the class or .jar file which contains this class into the Java classpath. When a Java class is run from the command line, one must add a dot (.)