Language: C++

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

class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> list = new ArrayList<Integer>();

    for(int i = 0; i < 3; i++) {
      list.add(sc.nextInt());
    }

    Collections.sort(list);

    Iterator<Integer> iter = list.iterator();
    while(iter.hasNext()) {
      System.out.print(iter.next());
      if(iter.hasNext()) {
        System.out.print(" ");
      }
    }
  }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
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.ArrayList;
      | ^~~~~~
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.Collections;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Iterator;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:9: error: expected ':' before 'static'
    7 |   public static void main(String args[]) {
      |         ^~~~~~~
      |         :
a.cc:7:27: error: 'String' has not been declared
    7 |   public static void main(String args[]) {
      |                           ^~~~~~
a.cc:25:2: error: expected ';' after class definition
   25 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:8:5: error: 'Scanner' was not declared in this scope
    8 |     Scanner sc = new Scanner(System.in);
      |     ^~~~~~~
a.cc:9:5: error: 'ArrayList' was not declared in this scope
    9 |     ArrayList<Integer> list = new ArrayList<Integer>();
      |     ^~~~~~~~~
a.cc:9:15: error: 'Integer' was not declared in this scope
    9 |     ArrayList<Integer> list = new ArrayList<Integer>();
      |               ^~~~~~~
a.cc:9:24: error: 'list' was not declared in this scope
    9 |     ArrayList<Integer> list = new ArrayList<Integer>();
      |                        ^~~~
a.cc:9:35: error: 'ArrayList' does not name a type
    9 |     ArrayList<Integer> list = new ArrayList<Integer>();
      |                                   ^~~~~~~~~
a.cc:9:54: error: expected primary-expression before ')' token
    9 |     ArrayList<Integer> list = new ArrayList<Integer>();
      |                                                      ^
a.cc:12:16: error: 'sc' was not declared in this scope
   12 |       list.add(sc.nextInt());
      |                ^~
a.cc:15:5: error: 'Collections' was not declared in this scope
   15 |     Collections.sort(list);
      |     ^~~~~~~~~~~
a.cc:17:5: error: 'Iterator' was not declared in this scope
   17 |     Iterator<Integer> iter = list.iterator();
      |     ^~~~~~~~
a.cc:17:23: error: 'iter' was not declared in this scope
   17 |     Iterator<Integer> iter = list.iterator();
      |                       ^~~~
a.cc:19:7: error: 'System' was not declared in this scope
   19 |       System.out.print(iter.next());
      |       ^~~~~~