Case 1:
public class line1{
int test1=666;
line2 l2=new line2();
l2.ShowIt(test1);
}
Example 2:
public class line1{
int test1=666;
line2 l2=new line2();
line1(){
l2.ShowIt(test1);
}}
Compiling the former results in the following error:
The reason is that the statement written to call a method is not in the right place in the class and must be placed in a method.
Read More:
- syntax error on token “catch”,Identifier expected
- Err: error parsing query: found name, expected identifier, string
- Common errors and modification methods of findbug
- Syntax error on token “eat”, identifier expected after this token
- R-common errors and their possible causes — Notes
- Common errors and solutions in MapReduce stage
- How to Solve Yolov5 Common Error (Three Errors)
- Analysis and solution of common errors in ArcEngine development
- Summary of common errors in angularjs
- Common errors reported by Eureka in spring cloud
- Common errors and solutions of Qt development application under Ubuntu
- Common errors in k8s initialization_ [WARNING NumCPU]_ [WARNING SystemVerification]_ WARNING Hostname
- Common solutions to errors in checkout or commit of SVN
- C + + common errors: “error: XXX in namespace ‘STD’ does not name a template type”
- SQL Union, union all usage and common errors and Solutions
- Kafka connection abnormal org.apache.kafka . common.errors.TimeoutException : Failed to update metadata after 60000 ms.
- Xcode Error: Embedded binary’s bundle identifier is not prefixed with the parent app’s bundle identifier
- JAVA lambda Syntax error on tokens, Expression expected instead
- Python error: pandas.errors.ParserError: Error tokenizing data. C error: Expected 3……
- Meven report error java.lang.NoSuchMethodError : com.google.common . base.Preconditions.checkArgument