criyle/codenet-compile-errors huggingface dataset:
Language: Java

class Main{
    public static void main(String[] a){
        for(int i=0;i<args.length;i++) {
			int no = Integer.parseInt(a[i]);
			printPrimes(no);
		}
    }

    public static void printPrimes(int no) {
		int cnt = 0;
		for(int i=2;i<=no;i++) {
			if(isPrime(i))
				cnt++;
		}
		System.out.println(cnt);
	}

     public static boolean isPrime(int no) {
		// TODO Auto-generated method stub
		int m = no/2;
		boolean p = true;
		for(int i=2;i<=m;i++) {
			if(no%i==0)
				p = false;
		}
		return p;
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
        for(int i=0;i<args.length;i++) {
                      ^
  symbol:   variable args
  location: class Main
1 error
Language: Java

class Main{
    public static void main(String[] a){
        if(a.length > 30)
			System.out.println("Data set is more than 30.");
		else {
		for(int i=0;i<a.length;i++) {
			int no = Integer.parseInt(a[i]);
			printPrimes(no);
		}
    }

    public static boolean isPrime(int no) {
		// TODO Auto-generated method stub
		int m = no/2;
		boolean p = true;
		for(int i=2;i<=m;i++) {
			if(no%i==0)
				p = false;
		}
		return p;
	}

    public static void printPrimes(int no) {
		int cnt = 0;
		for(int i=2;i<=no;i++) {
			if(isPrime(i))
				cnt++;
		}
		System.out.println(cnt);
	}
}

Compiler output:
Main.java:12: error: illegal start of expression
    public static boolean isPrime(int no) {
    ^
1 error
Language: Java

package GlobalSign;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void printPrimes(int no) {
		int cnt = 0;
		for(int i=2;i<=no;i++) {
			if(isPrime(i))
				cnt++;
		}
		System.out.println(cnt);
	}
	
	public static void main(String[] a) throws NumberFormatException, IOException {
		if(a.length == 0) {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			while((str = br.readLine()) != null){
	            printPrimes(Integer.parseInt(br.readLine()));
	        }
			
		}
		else {
		for(int i=0;i<a.length;i++) {
			int no = Integer.parseInt(a[i]);
			printPrimes(no);
		}
		}
	}

	public static boolean isPrime(int no) {
		// TODO Auto-generated method stub
		int m = no/2;
		boolean p = true;
		for(int i=2;i<=m;i++) {
			if(no%i==0)
				p = false;
		}
		return p;
	}
}

Compiler output:
Main.java:21: error: cannot find symbol
			while((str = br.readLine()) != null){
			       ^
  symbol:   variable str
  location: class Main
1 error
Language: Java

class Main{
    public static void main(String[] a){
        if(a.length == 0) {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String str;
			while((str = br.readLine()) != null){
	            printPrimes(Integer.parseInt(br.readLine()));
	        }
			
		}
		else {
		for(int i=0;i<a.length;i++) {
			int no = Integer.parseInt(a[i]);
			printPrimes(no);
		}
		}
    }

    public static void printPrimes(int no) {
		int cnt = 0;
		for(int i=2;i<=no;i++) {
			if(isPrime(i))
				cnt++;
		}
		System.out.println(cnt);
	}
    
    public static boolean isPrime(int no) {
		// TODO Auto-generated method stub
		int m = no/2;
		boolean p = true;
		for(int i=2;i<=m;i++) {
			if(no%i==0)
				p = false;
		}
		return p;
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			                                           ^
  symbol:   class InputStreamReader
  location: class Main
3 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
    public static void main(String[] a){
        if(a.length == 0) {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String str;
			while((str = br.readLine()) != null){
	            printPrimes(Integer.parseInt(br.readLine()));
	        }
			
		}
		else {
		for(int i=0;i<a.length;i++) {
			int no = Integer.parseInt(a[i]);
			printPrimes(no);
		}
		}
    }

    public static void printPrimes(int no) {
		int cnt = 0;
		for(int i=2;i<=no;i++) {
			if(isPrime(i))
				cnt++;
		}
		System.out.println(cnt);
	}
    
    public static boolean isPrime(int no) {
		// TODO Auto-generated method stub
		int m = no/2;
		boolean p = true;
		for(int i=2;i<=m;i++) {
			if(no%i==0)
				p = false;
		}
		return p;
	}
}

Compiler output:
Main.java:10: error: unreported exception IOException; must be caught or declared to be thrown
			while((str = br.readLine()) != null){
			                        ^
Main.java:11: error: unreported exception IOException; must be caught or declared to be thrown
	            printPrimes(Integer.parseInt(br.readLine()));
	                                                    ^
2 errors
Language: Java

package GlobalSign;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void printPrimes(int no) {
		int cnt = 0;
		for(int i=2;i<=no;i++) {
			if(isPrime(i))
				cnt++;
		}
		System.out.println(cnt);
	}
	
	public static void main(String[] a) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str;
		while((str = br.readLine()) != null){
            printPrimes(Integer.parseInt(str);
        }
	}

	public static boolean isPrime(int no) {
		// TODO Auto-generated method stub
		int m = (int) Math.sqrt(no);
		boolean p = true;
		for(int i=2;i<=m;i++) {
			if(no%i==0)
				p = false;
		}
		return p;
	}
}

Compiler output:
Main.java:22: error: ')' or ',' expected
            printPrimes(Integer.parseInt(str);
                                             ^
1 error
Language: Java

ublic class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner s = new Scanner(System.in);
		


		while(s.hasNext()){
			
			int n = s.nextInt();
			int ptr =0;
			int[] prime = new int[1000];
			
			if(n>1)
				prime[ptr++] = 2;
			if(n>2){
				prime[ptr++] = 3;
				
			
			for(int i = 5; i<= n ;i+=2){
				boolean check = true;
				for(int j = 1;j<ptr;j++){
					if(i % prime[j] == 0){
						check = false;
						break;
					}

				}
				if(check){
					prime[ptr++]=i;
				}

			}
			}
			System.out.println(ptr);

		}
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
ublic class Main {
^
1 error
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner s = new Scanner(System.in);
		


		while(s.hasNext()){
			
			int n = s.nextInt();
			int ptr =0;
			int[] prime = new int[1000];
			
			if(n>1)
				prime[ptr++] = 2;
			if(n>2){
				prime[ptr++] = 3;
				
			
			for(int i = 5; i<= n ;i+=2){
				boolean check = true;
				for(int j = 1;j<ptr;j++){
					if(i % prime[j] == 0){
						check = false;
						break;
					}

				}
				if(check){
					prime[ptr++]=i;
				}

			}
			}
			System.out.println(ptr);

		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner s = new Scanner(System.in);
		
		while(s.hasNext()){
			
			int n = s.nextInt();
			int ptr =0;
			
			int[] prime = new int[100];
			
			if(n>1){
				prime[ptr++] = 2;
			}
			if(n>2){
				prime[ptr++] = 3;
				for(int i = 5; i<= n ;i+=2){
					boolean check = true;
					for(int j = 1;j< ptr;j++){
						if(i % prime[j] == 0){
							check = false;
							break;
						}
						
					}
					if(check){
						prime[ptr++]=i;
					}

				}
			}
			
			System.out.println(Integer.toString(ptr));

		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner s = new Scanner(System.in);
		
		while(s.hasNext()){
			
			int n = s.nextInt();
			int ptr =0;
			
			int[] prime = new int[10000];
			
			if(n>1){
				prime[ptr++] = 2;
			}
			if(n>2){
				prime[ptr++] = 3;
				for(int i = 5; i<= n ;i+=2){
					boolean check = true;
					for(int j = 1;j< ptr;j++){
						if(i % prime[j] == 0){
							check = false;
							break;
						}
						
					}
					if(check){
						prime[ptr++]=i;
					}

				}
			}
			
			System.out.println(Integer.toString(ptr));

		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner s = new Scanner(System.in);
		
		while(s.hasNext()){
			
			int n = s.nextInt();
			int ptr =0;
			
			int[] prime = new int[10000];
			
			if(n>1){
				prime[ptr++] = 2;
			}
			if(n>2){
				prime[ptr++] = 3;
				for(int i = 5; i<= n ;i+=2){
					boolean check = true;
					for(int j = 1;j< ptr;j++){
						if(i % prime[j] == 0){
							check = false;
							//break;
						}
						
					}
					if(check){
						prime[ptr++]=i;
					}

				}
			}
			
			System.out.println(Integer.toString(ptr));

		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner s = new Scanner(System.in);
		
		while(s.hasNext()){
			
			int n = s.nextInt();
			int ptr =0;
			
			int[] prime = new int[10000];
			
			if(n>1){
				prime[ptr++] = 2;
			}
			if(n>2){
				prime[ptr++] = 3;
				for(int i = 5; i<= n ;i+=2){
					boolean check = true;
					for(int j = 1;j< ptr;j++){
						if(i % prime[j] == 0){
							check = false;
							break;
						}
						
					}
					if(check){
						//prime[ptr++] = i;
					}

				}
			}
			
			System.out.println(Integer.toString(ptr));

		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner s = new Scanner(System.in);
		
		while(s.hasNext()){
			
			int n = s.nextInt();
			int ptr =0;
			
			int[] prime = new int[1000];
			
			if(n>1){
				prime[ptr++] = 2;
			}
			if(n>2){
				prime[ptr++] = 3;
				for(int i = 5; i<= n ;i+=2){
					boolean check = true;
					for(int j = 1;j< ptr;j++){
						if(i % prime[j] == 0){
							check = false;
							break;
						}
						
					}
					if(check){
						//prime[ptr++] = i;
					}

				}
			}
			
			System.out.println(Integer.toString(ptr));

		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner s = new Scanner(System.in);
		
		while(s.hasNext()){
			
			int n = s.nextInt();
			int ptr =0;
			
			int[] prime = new int[1000];
			
			if(n>1){
				prime[ptr++] = 2;
			}
			if(n>2){
				prime[ptr++] = 3;
				for(int i = 5; i<= n ;i+=2){
					boolean check = true;
					for(int j = 1;j< ptr;j++){
						if(i % prime[j] == 0){
							check = false;
							break;
						}
						
					}
					if(check){
						//prime[ptr++] = i;
					}

				}
			}
			
			//System.out.println(Integer.toString(ptr));

		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNext()) {
			int n = in.nextInt();
			System.out.println(num_prime(n));
		}
		in.close();
	}

	static int num_prime(int n) {
		int num = 0;
		if (2 <= n)
			num++;
		for (int i = 3; i <= n; i = i + 2) {
			if (is_prime(i))
				num++;
		}
		return num;
	}

	static Boolean is_prime(int n) {
		if (n <= 1)
			return false;
		if (n == 2)
			return true;
		if (n % 2 == 0)
			return false;
		for (int i = 3; i * i <= n; i = i + 2) {
			if (n % i == 0)
				return false;
		}
		return true;
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

class Main {
	public static void main(String[] args) {
		int N_MAX = 999999 + 1;
		Boolean[] cands = new Boolean[N_MAX];
		int[] NumOfPrime = new int[N_MAX];
		int count = 0;
		Arrays.fill(cands, true);
		cands[0] = cands[1] = false;
		for (int i = 2; i < N_MAX; i++) {
			if (cands[i] == true) {
				count++;
				for (int j = i; j < N_MAX; j += i) {
					cands[j] = false;
				}
			}
			NumOfPrime[i] = count;
		}
		Scanner in = new Scanner(System.in);
		int n;
		while (in.hasNext()) {
			n = in.nextInt();
			System.out.println(NumOfPrime[n]);
		}
		in.close();
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		Arrays.fill(cands, true);
		^
  symbol:   variable Arrays
  location: class Main
Main.java:18: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:18: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

public class Prime {
	
	public static void main(String[] args) {
	
		String input;
		int datasetCount = 0;
		
		
		Scanner stdin = new Scanner(System.in);
		while (++datasetCount <= 30) {
			int primes = 0;
			input = stdin.nextLine();
			try {
				int n = Integer.parseUnsignedInt(input);
				
				if (n > 999999)
					break;
				
				for (int i = 2; i <= n; ++i) {
					
					if (isPrime(i))
						++primes;
					
				}
				
				System.out.print(primes);
				
				
			} catch (NumberFormatException nfe) {
				break;
			}
		}
		stdin.close();
	}
	
	
	private static boolean isPrime(int i) {
	
		for (int div = 2; div <= Math.sqrt(i); ++div) {
			if (i % div == 0)
				return false;
		}
		return true;
	}
}

Compiler output:
Main.java:3: error: class Prime is public, should be declared in a file named Prime.java
public class Prime {
       ^
1 error
Language: Java

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;


class Prime {
	
	public static void main(String[] args) {
	
		File inFile = new File(args[0]);
		Scanner datasets;
		try {

		} catch (FileNotFoundException e) {
			System.out.print("not found");
		}
	}
}

Compiler output:
Main.java:14: error: exception FileNotFoundException is never thrown in body of corresponding try statement
		} catch (FileNotFoundException e) {
		  ^
1 error
Language: Java

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;


class Main{
	
	public static void main(String[] args) {
	
		Scanner datasets = new Scanner(System.in);

String input;
		int datasetCount = 0;
		
		while (datasets.hasNextLine()) {
			
			int primes = 0;
			input = datasets.nextLine();
			try {
				int n = Integer.parseUnsignedInt(input);
				
				if (n > 999999)
					continue;
				
				for (int i = 2; i <= n; ++i) {
					
					if (isPrime(i))
						++primes;
					
				}
				
				System.out.print(primes + "\n");
				
				
			} catch (NumberFormatException nfe) {
				break;
			}
			if (++datasetCount >= 30) {
				break;
			}
		}
		datasets.close();
	}
}

Compiler output:
Main.java:27: error: cannot find symbol
					if (isPrime(i))
					    ^
  symbol:   method isPrime(int)
  location: class Main
1 error
Language: Java


class Main {
	
	public static void main(String[] args) {
	
		
		String input;
		int datasetCount = 0;
		
		for (int dataset = 0; dataset < args.length; ++dataset) {
			
			int primes = 0;
			input = args[dataset];
			try {
				int n = Integer.parseUnsignedInt(input);
				
				if (n > 999999)
					break;
				
				for (int i = 2; i <= n; ++i) {
					
					if (isPrime(i))
						++primes;
					
				}
				
				System.out.print(primes + "\n");
				
				
			} catch (NumberFormatException nfe) {
				break;
			}
			if (++datasetCount >= 30) {
				break;
			}
		}
		datasets.close();
		
	}
	
	
	private static boolean isPrime(int i) {
	
		for (int div = 2; div <= Math.sqrt(i); ++div) {
			if (i % div == 0)
				return false;
		}
		return true;
	}
}

Compiler output:
Main.java:37: error: cannot find symbol
		datasets.close();
		^
  symbol:   variable datasets
  location: class Main
1 error
Language: Java


class Main {
	
	public static void main(String[] args) {
	
		
		String input;
		int datasetCount = 0;
		
		for (int dataset = 0; dataset < args.length; ++dataset) {
			
			int primes = 0;
			input = args[dataset];
			
		}
		datasets.close();
		
	}
	
	
	private static boolean isPrime(int i) {
	
		for (int div = 2; div <= Math.sqrt(i); ++div) {
			if (i % div == 0)
				return false;
		}
		return true;
	}
}

Compiler output:
Main.java:16: error: cannot find symbol
		datasets.close();
		^
  symbol:   variable datasets
  location: class Main
1 error
Language: Java


class Main {
	
	public static void main(String[] args) {
	
		
		String input;
		int datasetCount = 0;
		
		for (int dataset = 0; dataset < args.length; ++dataset) {
			
			int primes = 0;
			
			
		}
		datasets.close();
		
	}
	
	
	private static boolean isPrime(int i) {
	
		for (int div = 2; div <= Math.sqrt(i); ++div) {
			if (i % div == 0)
				return false;
		}
		return true;
	}
}

Compiler output:
Main.java:16: error: cannot find symbol
		datasets.close();
		^
  symbol:   variable datasets
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


class Main {
	
	public static void main(String[] args) throws IOException {
	
		
		
		String input;
		int datasetCount = 0;
		
		while ((input = bf.readLine()) != null) {
			int primes = 0;
			

			try {
				int n = Integer.parseUnsignedInt(input);
				
				if (n > 999999)
					continue;
				
				for (int i = 3; i <= n; i += 2) {
					
					if (isPrime(i))
						++primes;

					
				}
				

				System.out.print(primes);
				
				
			} catch (NumberFormatException nfe) {
				break;
			}
			if (++datasetCount >= 30) {
				break;
			}
		}
	}
	
	
	private static boolean isPrime(int i) {
	
		for (int div = 2; div <= Math.sqrt(i); div += 1) {
			if (i % div == 0)
				return false;
		}
		return true;
	}
}

Compiler output:
Main.java:15: error: cannot find symbol
		while ((input = bf.readLine()) != null) {
		                ^
  symbol:   variable bf
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * @author Rikenkou
 *
 */
public class PrimeNumber {

	public int numPrime(int integerNo){
		int numPrime = 0;
		for(int testNo = 2; testNo <= integerNo; testNo++){
			if(isPrimeNo(testNo) == true)	numPrime++;
		}
		return numPrime;
	}

	public boolean isPrimeNo(int testNo){
		boolean isPrime = false;

		int remainder = 1;
		int quotient = testNo;

		for(int divisor = 2; divisor <= quotient; divisor++){
			quotient = testNo / divisor;
			if(quotient < divisor){
				isPrime = true;
				break;
			}
			remainder = testNo % divisor;
			if(remainder == 0){
				isPrime = false;
				break;
			}

			if(quotient == divisor){
				isPrime = true;
				break;
			}
		}
		return isPrime;
	}

	public static void main(String[] args){
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		while(true){
			try{
				String buf = br.readLine();
				if(buf == null) break;
				int integerNo = Integer.parseInt(buf);
				PrimeNumber primeNumber = new PrimeNumber();
				System.out.println(primeNumber.numPrime(integerNo));
			}catch(Exception e){
				System.out.print(e);
				break;
			}
		}
	}

}

Compiler output:
Main.java:8: error: class PrimeNumber is public, should be declared in a file named PrimeNumber.java
public class PrimeNumber {
       ^
1 error
Language: Java

import java.io.*;
import java.util.HashMap;

public class Vol0_0009
{
    static HashMap<Integer, Boolean> prime;

    static boolean isprime(int n)
    {
	if (n==2) {
	    return true;
	} else if (n % 2==0) {
	    return false;
	} else if (prime.containsKey(n)) {
	    return prime.get(n);
	} else {
	    for (int i=3; i<=Math.sqrt(n); i+=2){
		if (n % i == 0) {
		    prime.put(n,false);
		    return false;
		}
	    }
	    prime.put(n, true);
	    return true;
	}
    }

    static int nprime(int n)
    {
	if (n==2) {
	    return 1;
	}
	int num=1;
	for (int i=3; i<=n; i+=2){
	    if (isprime(i)){
		num += 1;
	    }
	}
	return num;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = "";
	prime = new HashMap<Integer, Boolean>();
        while ((line = br.readLine()) != null && !line.isEmpty()) {
	    int n = Integer.parseInt(line);
	    System.out.println(nprime(n));
	}
    }
}

Compiler output:
Main.java:4: error: class Vol0_0009 is public, should be declared in a file named Vol0_0009.java
public class Vol0_0009
       ^
1 error
Language: Java

function prime(max){
   var arr=[];
   for(var i=0;i<=max;i++)arr[i]=i;
   arr[0]=false;
   arr[1]=false;
   var sqrt=Math.floor(Math.sqrt(max));
   for(var i=2;i<=sqrt;i++){
      if(arr[i]==false)continue;
         for(var j=i+i;j<=max;j+=i){
            arr[j]=false;
         }
   }
   var result=[];
   for(var i=0;i<=max;i++){
      if(arr[i]!==false)result.push(arr[i]);
   }
   return result;
}
var p=prime(999999);
 
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n").map(Number);
for(var i=0;i<Arr.length;i++){
   var a=Arr[i];
   for(var j=0;j<p.length;j++){
      if(p[j]>a)break;
   }
   console.log(j);
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
function prime(max){
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
function prime(max){
                  ^
Main.java:2: error: illegal start of expression
   var arr=[];
           ^
Main.java:13: error: illegal start of expression
   var result=[];
              ^
Main.java:15: error: illegal start of expression
      if(arr[i]!==false)result.push(arr[i]);
                 ^
Main.java:21: error: unclosed character literal
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
                    ^
Main.java:21: error: unclosed character literal
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
                       ^
Main.java:21: error: unclosed character literal
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
                                       ^
Main.java:21: error: unclosed character literal
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
                                                  ^
Main.java:21: error: unclosed character literal
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
                                                     ^
Main.java:21: error: unclosed character literal
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
                                                          ^
Main.java:23: error: class, interface, enum, or record expected
for(var i=0;i<Arr.length;i++){
^
Main.java:23: error: class, interface, enum, or record expected
for(var i=0;i<Arr.length;i++){
            ^
Main.java:23: error: class, interface, enum, or record expected
for(var i=0;i<Arr.length;i++){
                         ^
Main.java:25: error: class, interface, enum, or record expected
   for(var j=0;j<p.length;j++){
   ^
Main.java:25: error: class, interface, enum, or record expected
   for(var j=0;j<p.length;j++){
               ^
Main.java:25: error: class, interface, enum, or record expected
   for(var j=0;j<p.length;j++){
                          ^
Main.java:27: error: class, interface, enum, or record expected
   }
   ^
Main.java:29: error: class, interface, enum, or record expected
}
^
19 errors
Language: Java

import java.io.*;
import java.util.*;
public class Kimoi {

    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        while(true){
            try{
                System.out.println(prime_number(Integer.parseInt(br.readLine())));
            }catch(Exception e){
                System.exit(0);
            }
        }
    }
    
    static int prime_number(int n){
        boolean[] array=new boolean[n+1];
        Arrays.fill(array, true);
        int i=2;
        array[0]=false;
        array[1]=false;
        while(Math.pow(i, 2)<=n){
            int j=i+i;
            while(j<=n){
                array[j]=false;
                j+=i;
            }
            i++;
        }
        
        int count=0;
        for(i=0;i<array.length;i++){
            if(array[i]) count++;
        }
        
        return count;
    }
}

Compiler output:
Main.java:3: error: class Kimoi is public, should be declared in a file named Kimoi.java
public class Kimoi {
       ^
1 error
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<>();
        while(sc.hasNext()){
            ans.add("" + primeCount(sc.nextInt()));
        }
        for(int i = 0,size = and.size();i < size;i++) System.out.println(ans.get(i));
    }
    static int primeCount(int num){
        ArrayList<Integer> list = new ArrayList<>();
        for(int i = 2;i <= num;i++) list.add(i);
        for(int i = 0;i < list.size() && list.get(i) < Math.sqrt(num);i++){
            for(int j = i + 1;j < list.size();j++){
                if(list.get(j) % list.get(i) == 0) list.remove(j--);
            }
        }
        return list.size();
    }
}

Compiler output:
Main.java:10: error: cannot find symbol
        for(int i = 0,size = and.size();i < size;i++) System.out.println(ans.get(i));
                             ^
  symbol:   variable and
  location: class Main
1 error
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<>();
        while(sc.hasNext()){
            ans.add("" + primeCount(sc.nextInt()));
        }
        for(int i = 0,size = ans.size();i < size;i++) System.out.println(ans.get(i));
    }
    static int primeCount(int num){
        ArrayList<Integer> list = new ArrayList<>();
        for(int i = 2;i <= num;i++) list.add(i);
        for(int i = 0;i < list.size() && list.get(i) < Math.sqrt(num);i++){
            for(int j = i + 1;j < list.size();j++){
                if(list.get(j) % list.get(i) == 0) list.remove(j--);
            }
        }
    }
}

Compiler output:
Main.java:20: error: missing return statement
    }
    ^
1 error
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<>();
        int i = 0;
        while(sc.hasNext() && i++ < 30){
            ans.add("" + primeCount(sc.nextInt()));
        }
        for(int i = 0,size = ans.size();i < size;i++) System.out.println(ans.get(i));
    }
    static int primeCount(int num){
        ArrayList<Integer> list = new ArrayList<>();
        for(int i = 2;i <= num;i++) list.add(i);
        for(int i = 0;i < list.size() && list.get(i) < Math.sqrt(num);i++){
            for(int j = i + 1;j < list.size();j++){
                if(list.get(j) % list.get(i) == 0) list.remove(j--);
            }
        }
        return list.size();
    }
}

Compiler output:
Main.java:11: error: variable i is already defined in method main(String[])
        for(int i = 0,size = ans.size();i < size;i++) System.out.println(ans.get(i));
                ^
1 error
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> ans = new ArrayList<String>();
        boolean[] map = new boolean[999999];
        for(int i = 0;i < 999999;i++) map[i] = true;
        for(int i = 0;i < 999999;i++){
            if(map[i]){
                for(int j = 2;(i + 1) * j < 999999;j++){
                    if(map[i * j]) map[i * j] = false;
                }
            }
        }
        while(sc.hasNext()){
            int cnt = 0;
            for(int i = 0;i < sc.nextInt();i++){
                if(map[i]) cnt++;
            }
            ans.add(cnt);
        }
        for(int i = 0,size = ans.size();i < size;i++) System.out.println(ans.get(i));
    }
}

Compiler output:
Main.java:21: error: incompatible types: int cannot be converted to String
            ans.add(cnt);
                    ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static int countPrime(int n){
		int cnt = 0
		if(n < 2){
			cnt = 0;
			return cnt;
		}
		if(n == 2){
			cnt++;
			return cnt;
		}
		if(n > 2)cnt++;
		for(int i = 3; i <= n; i += 2){
			for(int j = 3; j < i; j += 2){
				if(i % j == 0)break;
			}
			if(j == i)cnt++;
		}
		return cnt;
	}

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int cnt = countPrime(n);
		list.add(cnt);

		for(int n : list){
			System.out.printf("%d\n", n);
		}
	}
}

Compiler output:
Main.java:7: error: ';' expected
		int cnt = 0
		           ^
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static int countPrime(int n){
		int cnt = 0;
		if(n < 2){
			cnt = 0;
			return cnt;
		}
		if(n == 2){
			cnt++;
			return cnt;
		}
		if(n > 2)cnt++;
		for(int i = 3; i <= n; i += 2){
			for(int j = 3; j < i; j += 2){
				if(i % j == 0)break;
			}
			if(j == i)cnt++;
		}
		return cnt;
	}

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int cnt = countPrime(n);
		list.add(cnt);

		for(int n : list){
			System.out.printf("%d\n", n);
		}
	}
}

Compiler output:
Main.java:21: error: cannot find symbol
			if(j == i)cnt++;
			   ^
  symbol:   variable j
  location: class Main
Main.java:32: error: variable n is already defined in method main(String[])
		for(int n : list){
		        ^
2 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static int countPrime(int n){
		int cnt = 0
		boolean flag = true;
		if(n <= 1)return cnt;
		if(n == 2){
			cnt++;
			return cnt;
		}
		cnt++;
		for(int i = 3; i <= n; i += 2){
			for(int j = 3; j <= Math.sqrt(i); j += 2){
				if(i % j == 0){
					flag = false;
					break;
				}
			}
			if(flag)cnt++;
			else flag = true;
		}
		return cnt;
	}

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		while(scan.hasNext()){
			int cnt = 0;
			int n = scan.nextInt();
			cnt = countPrime(n);
			list.add(cnt);
		}
		for(int n : list){
			System.out.printf("%d\n", n);
		}
	}
}

Compiler output:
Main.java:7: error: ';' expected
		int cnt = 0
		           ^
1 error
Language: Java


public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner scn = new Scanner(System.in);
		List<Integer> a = new ArrayList<Integer>();
		boolean b = true;
		while(b){
			try{
				a.add(scn.nextInt());				
				}
				catch(Exception e){
					b = false;
				}
		}

		for (int seiseki: a){
			  System.out.println(seiseki);
		}
		boolean flag = false;
		List<Integer> list = new ArrayList<Integer>();
		for (int test: a){		
			for(int i=2;test>i;i++){
				for(int k=2;i>k;k++){
					if(i%k==0){
						flag = false;
						break;
					}else{
						flag = true;
					}
				}
				if(flag){
					list.add(i);
				}
			}
			System.out.print(list.size());
		}
	}

}

Compiler output:
Main.java:6: error: cannot find symbol
		Scanner scn = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
		Scanner scn = new Scanner(System.in);
		                  ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
		List<Integer> a = new ArrayList<Integer>();
		^
  symbol:   class List
  location: class Main
Main.java:7: error: cannot find symbol
		List<Integer> a = new ArrayList<Integer>();
		                      ^
  symbol:   class ArrayList
  location: class Main
Main.java:22: error: cannot find symbol
		List<Integer> list = new ArrayList<Integer>();
		^
  symbol:   class List
  location: class Main
Main.java:22: error: cannot find symbol
		List<Integer> list = new ArrayList<Integer>();
		                         ^
  symbol:   class ArrayList
  location: class Main
6 errors
Language: Java

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;

public class Main
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int[] data = new int[1000000];
        boolean[] isPrime = new boolean[1000000];
        //default??§false. ?´???°????????°false,?´???°??§??????????????°true??¨??????.
        isPrime[0] = true;
        isPrime[1] = true;
        int count = 0;
        int max = (int)Math.sqrt(1000000);
        
        for(int i = 2; i < 1000000; i++){

            if(!isPrime[i]){
                count++;
                if(i <= max){
                    for(int j = i*i; j < 1000000; j+=i){
                        if(j <= 0) break;
                        isPrime[j] = true;
                    }
                }
            }

            data[i] = count;
        }

        String line;

        while( (line = br.readLine()) != null){
            System.out.println(data[Integer.parseInt(line)]);
        }

    }
}

Compiler output:
Main.java:5: error: '{' expected
public class Main
                 ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args) throws IOException{
                  ^
  (use --enable-preview to enable unnamed classes)
Main.java:39: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Volume0009 {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

	    try
	    {
	    	String str = null;
		    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		    str = br.readLine();

			int n = Integer.parseInt(str);
			int count = 0;
			for(int i = 2; i <= n; i++ )
			{
				double max = Math.sqrt(i);
				boolean isPrime = true;
				for(int j = 2; j <= max; j++)
				{
					int s = i % j;
					if(s == 0)
					{
						isPrime = false;
						break;
					}
					else
					{
						isPrime = true;
					}
				}

				if(isPrime)
				{
					count++;
				}
			}

			System.out.println(count);

	    }catch(Exception ex)
	    {

	    }
	}

}

Compiler output:
Main.java:4: error: class Volume0009 is public, should be declared in a file named Volume0009.java
public class Volume0009 {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Volume0009 {

	public static void main(String[] args) {
	    try
	    {
	    	String str = null;
		    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		    while(true)
		    {
			    str = br.readLine();

				int n = Integer.parseInt(str);
				int count = 0;
				for(int i = 2; i <= n; i++ )
				{
					double max = Math.sqrt(i);
					boolean isPrime = true;
					for(int j = 2; j <= max; j++)
					{
						int s = i % j;
						if(s == 0)
						{
							isPrime = false;
							break;
						}
						else
						{
							isPrime = true;
						}
					}

					if(isPrime)
					{
						count++;
					}
				}

				System.out.println(count);
		    }

	    }catch(Exception ex)
	    {
	    }
	}
}

Compiler output:
Main.java:4: error: class Volume0009 is public, should be declared in a file named Volume0009.java
public class Volume0009 {
       ^
1 error
Language: Java

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
 
public class AAAA{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        int[] data = new int[1000000];
        boolean[] isPrime = new boolean[1000000];
        //default???§false. ??´????°?????????°false,??´????°???§???????????????°true???¨??????.
        isPrime[0] = true;
        isPrime[1] = true;
        int count = 0;
        int max = (int)Math.sqrt(1000000);
         
        for(int i = 2; i < 1000000; i++){
 
            if(!isPrime[i]){
                count++;
                if(i <= max){
                    for(int j = i*i; j < 1000000; j+=i){
                        if(j <= 0) break;
                        isPrime[j] = true;
                    }
                }
            }
 
            data[i] = count;
        }
 
        String line;
 
        while( (line = br.readLine()) != null){
            System.out.println(data[Integer.parseInt(line)]);
        }
 
    }
}

Compiler output:
Main.java:5: error: class AAAA is public, should be declared in a file named AAAA.java
public class AAAA{
       ^
1 error
Language: Java

class Main {
	static int primeNum(int n){
		int count = 0;
		
		for(int i = 2; i <= n; i ++){
			if(isThisPrime(i)){
				count ++;
			}
		}
		
		return count;
	}
	
	static boolean isThisPrime(int n){
		if(n != 2 | n % 2 == 0){
			for(int i = 2; i < n; i = i + 1){
				if(n % i == 0){
					return false;
				}
			}
		}
		
		return true;
	}
	
    public static void main(String[] args){
    	Scanner in = new Scanner(System.in);
    	int i = 0;
    	
    	while(i < 10){
    		System.out.println(primeNum(in.nextInt()));
    	}
    	
    	in.close();
	}
}

Compiler output:
Main.java:27: error: cannot find symbol
    	Scanner in = new Scanner(System.in);
    	^
  symbol:   class Scanner
  location: class Main
Main.java:27: error: cannot find symbol
    	Scanner in = new Scanner(System.in);
    	                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
public class Main1 {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int number[] = new int[30];
		int yakusuu = 0;
		int[] primeNumber = new int[30];
		int datasetNum = 3;
		for(int i = 0; i < datasetNum ; i++) {
			number[i] = stdin.nextInt();
			for(int j = 1; j <= number[i]; j++) {

				for(int k = 1; k <=j; k++ ) {

					if(j % k == 0) {

						yakusuu++;

					}

				}

				if(yakusuu == 2) {
					primeNumber[i]++;
				}
				yakusuu = 0;
			}


		}

		for(int i =0; i < datasetNum; i++) {

			System.out.println(primeNumber[i]);
		}

	}

}

Compiler output:
Main.java:2: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int datasetNum = stdin.nextInt();
		int yakusuu = 0;
		int primeNumber = 0;
		boolean judge = false;

		for(int i = 0; i < datasetNum; i++) {
			Scanner stdin = new Scanner(System.in);
			int number = stdin.nextInt();
			for(int j = 2; j <= number; j++) {
				if(j % 2 == 0 && j / 2 != 1)
					continue;
				for(int k = 2; k <= j - 1; k++) {

					if(j % k == 0) {

						judge = true;
						break;
					}
				}

				if(judge == false) {
					primeNumber++;
				}
				judge = false;
			}

			System.out.println(primeNumber);
			primeNumber = 0;

		}


	}
}

Compiler output:
Main.java:14: error: variable stdin is already defined in method main(String[])
			Scanner stdin = new Scanner(System.in);
			        ^
1 error
Language: Java

import java.util.Scanner;

public class Main1 {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int datasetNum = 10;
		int[] primeNumber = new int[datasetNum];
		boolean judge = false;

		for(int i = 0; i < datasetNum; i++) {

			int number = stdin.nextInt();
			for(int j = 2; j <= number; j++) {
				if(j % 2 == 0 && j / 2 != 1)
					continue;
				for(int k = 2; k <= j - 1; k++) {

					if(j % k == 0) {

						judge = true;
						break;
					}
				}

				if(judge == false) {
					primeNumber[i]++;
				}
				judge = false;
			}

		}

		for(int i = 0; i < datasetNum; i++) {
			System.out.println(primeNumber[i]);
		}

	}
}

Compiler output:
Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
1 error
Language: Java

import java.util.Scanner;

public class P0009 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while(true){
			int a=sc.nextInt();
			System.out.println(kosu(a));
		}
		
	}


	//a????´???°??????????????????
	public static boolean hantei(int a){
		if(a==1){
			return false;
		}else if(a==2){
			return true;
		}else{
			for(int i=2; i<=Math.sqrt(a); i++){
				if(a%i==0){

					return false;

				}
			}
			return true;
		}

	}

	public static int kosu(int a){
		int count=0;
		for(int i=2; i<=a; i++){
			if(hantei(i)){
				count++;
			}

		}

		return count;
	}



}

Compiler output:
Main.java:3: error: class P0009 is public, should be declared in a file named P0009.java
public class P0009 {
       ^
1 error
Language: Java

import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = line = sc.nextLine();
        while (line != null) {
          int num = Integer.parseInt(line);
          int result = calculatePrimeNumberQty(num);
          System.out.println(result);
        }
    }

    private static calculatePrimeNumberQty(int argNum) {
      int cnt = 0;
      for (int num = 2; num < argNum; num++) {
        boolean isPrime = judgePrimeNumber(num);
        if (isPrime) {
          cnt++
        }
      }
      return cnt;
    }

    private boolean judgePrimeNumber(int num) {
      if (num == 2) return true;
      if (num % 2 == 0) return false;

      for (int i=2; i < num; i++) {
        if (num % i == 0) return false;
      }
      return true;
    }
}

Compiler output:
Main.java:15: error: invalid method declaration; return type required
    private static calculatePrimeNumberQty(int argNum) {
                   ^
Main.java:20: error: ';' expected
          cnt++
               ^
2 errors
Language: Java

import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = line = sc.nextLine();
        while (line != null) {
          int num = Integer.parseInt(line);
          int result = calculatePrimeNumberQty(num);
          System.out.println(result);
        }
    }

    private static calculatePrimeNumberQty(int argNum) {
      int cnt = 0;
      for (int num = 2; num < argNum; num++) {
        boolean isPrime = judgePrimeNumber(num);
        if (isPrime) {
          cnt++;
        }
      }
      return cnt;
    }

    private boolean judgePrimeNumber(int num) {
      if (num == 2) return true;
      if (num % 2 == 0) return false;

      for (int i=2; i < num; i++) {
        if (num % i == 0) return false;
      }
      return true;
    }
}

Compiler output:
Main.java:15: error: invalid method declaration; return type required
    private static calculatePrimeNumberQty(int argNum) {
                   ^
1 error
Language: Java

import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = line = sc.nextLine();
        while (line != null) {
          int num = Integer.parseInt(line);
          int result = calculatePrimeNumberQty(num);
          System.out.println(result);
        }
    }

    private static calculatePrimeNumberQty(int argNum) {
      int cnt = 0;
      for (int num = 2; num < argNum; num++) {
        boolean isPrime = judgePrimeNumber(num);
        if (isPrime) {
          cnt++;
        }
      }
      return cnt;
    }

    private static boolean judgePrimeNumber(int num) {
      if (num == 2) return true;
      if (num % 2 == 0) return false;

      for (int i=2; i < num; i++) {
        if (num % i == 0) return false;
      }
      return true;
    }
}

Compiler output:
Main.java:15: error: invalid method declaration; return type required
    private static calculatePrimeNumberQty(int argNum) {
                   ^
1 error
Language: Java

import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextLine();) {
          String line = sc.nextLine();
          int num = Integer.parseInt(line);
          int result = calculatePrimeNumberQty(num);
          System.out.println(result);
        }
    }

    private static int calculatePrimeNumberQty(int argNum) {
      if (argNum == 2) return 1;
        
      int cnt = 0;
      for (int num = 2; num < argNum; num++) {
        boolean isPrime = judgePrimeNumber(num);
        if (isPrime) {
          cnt++;
        }
      }
      return cnt;
    }

    private static boolean judgePrimeNumber(int num) {
      if (num == 2) return true;
      if (num % 2 == 0) return false;

      for (int i=2; i < num; i++) {
        if (num % i == 0) return false;
      }
      return true;
    }
}

Compiler output:
Main.java:7: error: ')' expected
        while (sc.hasNextLine();) {
                               ^
Main.java:7: error: illegal start of expression
        while (sc.hasNextLine();) {
                                ^
2 errors