Language: C++

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class Main {
    private void topThreeHills() {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> hlist = new ArrayList<Integer>(10);
        while (sc.hasNext()) {
            hlist.add(sc.nextInt());
        }
        Collections.sort(hlist, Collections.reverseOrder());
        for (int i = 0; i < 3; i++) {
            System.out.println(hlist.get(i));
        }
    }

    public static void main(String[] args) {
        (new Main()).topThreeHills();
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.ArrayList;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Collections;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.Scanner;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:12: error: expected ':' before 'void'
    6 |     private void topThreeHills() {
      |            ^~~~~
      |            :
a.cc:18:11: error: expected ':' before 'static'
   18 |     public static void main(String[] args) {
      |           ^~~~~~~
      |           :
a.cc:18:29: error: 'String' has not been declared
   18 |     public static void main(String[] args) {
      |                             ^~~~~~
a.cc:18:38: error: expected ',' or '...' before 'args'
   18 |     public static void main(String[] args) {
      |                                      ^~~~
a.cc:21:2: error: expected ';' after class definition
   21 | }
      |  ^
      |  ;
a.cc: In member function 'void Main::topThreeHills()':
a.cc:7:9: error: 'Scanner' was not declared in this scope
    7 |         Scanner sc = new Scanner(System.in);
      |         ^~~~~~~
a.cc:8:9: error: 'ArrayList' was not declared in this scope
    8 |         ArrayList<Integer> hlist = new ArrayList<Integer>(10);
      |         ^~~~~~~~~
a.cc:8:19: error: 'Integer' was not declared in this scope
    8 |         ArrayList<Integer> hlist = new ArrayList<Integer>(10);
      |                   ^~~~~~~
a.cc:8:28: error: 'hlist' was not declared in this scope
    8 |         ArrayList<Integer> hlist = new ArrayList<Integer>(10);
      |                            ^~~~~
a.cc:8:40: error: 'ArrayList' does not name a type
    8 |         ArrayList<Integer> hlist = new ArrayList<Integer>(10);
      |                                        ^~~~~~~~~
a.cc:9:16: error: 'sc' was not declared in this scope
    9 |         while (sc.hasNext()) {
      |                ^~
a.cc:12:9: error: 'Collections' was not declared in this scope
   12 |         Collections.sort(hlist, Collections.reverseOrder());
      |         ^~~~~~~~~~~
a.cc:14:13: error: 'System' was not declared in this scope
   14 |             System.out.println(hlist.get(i));
      |             ^~~~~~
a.cc: In static member function 'static void Main::main(int*)':
a.cc:19:22: error: request for member 'topThreeHills' in '(operator new(1), ((true, (((*(Main*)<anonymous>) = Main()), (<anonymous> = false))), ((Main*)<anonymous>)))', which is of pointer type 'Main*' (maybe you meant to use '->' ?)
   19 |         (new Main()).topThreeHills();
      |                      ^~~~~~~~~~~~~