M
M
Makaron30002021-06-23 10:33:44
Java
Makaron3000, 2021-06-23 10:33:44

Why does it give an illegal start of expression error?

I don’t understand why it doesn’t run the code and gives an illegal start of expression error

package InputandOtput;
import java.io.*;

public class ReadBytes {
    public static void main(String[] args){
        throws IOException {
            byte[] data = new byte[10];
            System.out.println("Enter Symbol");
            System.in.read(data);
            System.out.println("You enter: ");
            for (int i = 0; i < data.length; i++) {
                System.out.print(data[i]);
            }
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2021-06-23
@Makaron3000

public static void main(String[] args){  -- лишняя {
        throws IOException {

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question