Language: Java

import java.util.*;
import java.io.*;
class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	String str = scan.next();
    	int N = Integer.parseInt(str);
      	str = scan.next();
      	int L = Integer.parseInt(str);
      	List<String> list = new ArrayList<>();
      	
      	for(int i = 0; i < N; i++){
        	String input = scan.next();
          	list.add(input);
        }
      	
      	Arrays.sort(list);
      	String ans;
      	for(i = 0; 2 ; i++){
        	input = list.get(i);
          	ans = ans + input;
        }
    	System.out.println(ans);
    }
}

Compiler output:
Main.java:17: error: no suitable method found for sort(List<String>)
      	Arrays.sort(list);
      	      ^
    method Arrays.sort(int[]) is not applicable
      (argument mismatch; List<String> cannot be converted to int[])
    method Arrays.sort(long[]) is not applicable
      (argument mismatch; List<String> cannot be converted to long[])
    method Arrays.sort(short[]) is not applicable
      (argument mismatch; List<String> cannot be converted to short[])
    method Arrays.sort(char[]) is not applicable
      (argument mismatch; List<String> cannot be converted to char[])
    method Arrays.sort(byte[]) is not applicable
      (argument mismatch; List<String> cannot be converted to byte[])
    method Arrays.sort(float[]) is not applicable
      (argument mismatch; List<String> cannot be converted to float[])
    method Arrays.sort(double[]) is not applicable
      (argument mismatch; List<String> cannot be converted to double[])
    method Arrays.sort(Object[]) is not applicable
      (argument mismatch; List<String> cannot be converted to Object[])
    method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable
      (cannot infer type-variable(s) T#1
        (actual and formal argument lists differ in length))
    method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>)
    T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>)
Main.java:19: error: cannot find symbol
      	for(i = 0; 2 ; i++){
      	    ^
  symbol:   variable i
  location: class Main
Main.java:19: error: incompatible types: int cannot be converted to boolean
      	for(i = 0; 2 ; i++){
      	           ^
Main.java:19: error: cannot find symbol
      	for(i = 0; 2 ; i++){
      	               ^
  symbol:   variable i
  location: class Main
Main.java:20: error: cannot find symbol
        	input = list.get(i);
        	^
  symbol:   variable input
  location: class Main
Main.java:20: error: cannot find symbol
        	input = list.get(i);
        	                 ^
  symbol:   variable i
  location: class Main
Main.java:21: error: cannot find symbol
          	ans = ans + input;
          	            ^
  symbol:   variable input
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
7 errors