Relative Content

Tag Archive for javacompiler-errors

Compiling error in Java program says “Missing method body or declare abstract”

So I tried to get back to Java after 2 years, having forgotten alomost everything I had learnt, so I wanted to start with something basic but I’ve ran into an error next to the ‘public static void main ()’ line, saying missing method body, I just typed a basic code to check if an enetered number is even or not, so could someone tell me what I am doing wrong. Please? If it helps I use the BlueJ IDE.

Errors in java backend

Getting error as “he constructor IndexWriterConfig(Analyzer) is undefined” and “The constructor IndexWriter(Directory, IndexWriterConfig) is undefined”. Any Resolve for this.

putting a try-catch block fixed compilation error in program

I wanted to read from a file using the Scanner class and when i implemented it it keeps throwing File-not-found exception but i checked multiple times with a couple of methods listed in the code and even made another file to read from and from different parts of the directory and still the same error was thrown but just as a put a try-catch block around the declaration of the Scanner object the program compiled and run without any errors
`import java.util.Scanner;
import java.io.File;
import java.io.PrintWriter;