Language: C++

import java.io.*;

class Main {
    public static void main(String[] args) {
    	
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	boolean end = false;
		try {
			while(end == false){
				//??\?????????????????????
		    	String temp = br.readLine();
		    	String[] numbers = temp.split(" ");//????????¨??????????????????
		    	int H = Integer.parseInt(numbers[0]);;//??????
		    	int W = Integer.parseInt(numbers[1]);;//???
		    	
		    	if(H >= 3 && W <= 100){
			    	//????§???¢??????????????????
			    	for(int i = 0; i < H ; i++){
			    		
			    		if(i == 0 || i == H - 1){
				    		for(int j = 0; j < W ; j++){
				    			System.out.print("#");
				    		}
			    		}else{
			    			System.out.print("#");
				    		for(int j = 1; j < W - 1; j++){
				    			System.out.print(".");
				    		}
				    		System.out.print("#");
			    		}

			    		System.out.println();//?¬??????????
			    	}
			    	System.out.println();//??????

		    	}else if(H == 0 && W == 0){
		    		end = true;//HW?????????0??????????????????
		    	}
			}
	    	
		} catch (IOException e) {
			// TODO ????????????????????? catch ????????????
			e.printStackTrace();
		}
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String[] args) {
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String[] args) {
      |                             ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
    4 |     public static void main(String[] args) {
      |                                      ^~~~
a.cc:46:2: error: expected ';' after class definition
   46 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:6:9: error: 'BufferedReader' was not declared in this scope
    6 |         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      |         ^~~~~~~~~~~~~~
a.cc:7:9: error: 'boolean' was not declared in this scope; did you mean 'bool'?
    7 |         boolean end = false;
      |         ^~~~~~~
      |         bool
a.cc:9:31: error: 'end' was not declared in this scope
    9 |                         while(end == false){
      |                               ^~~
a.cc:11:25: error: 'String' was not declared in this scope
   11 |                         String temp = br.readLine();
      |                         ^~~~~~
a.cc:12:32: error: expected primary-expression before ']' token
   12 |                         String[] numbers = temp.split(" ");//????????¨??????????????????
      |                                ^
a.cc:13:33: error: 'Integer' was not declared in this scope
   13 |                         int H = Integer.parseInt(numbers[0]);;//??????
      |                                 ^~~~~~~
a.cc:13:50: error: 'numbers' was not declared in this scope
   13 |                         int H = Integer.parseInt(numbers[0]);;//??????
      |                                                  ^~~~~~~
a.cc:22:57: error: 'System' was not declared in this scope
   22 |                                                         System.out.print("#");
      |                                                         ^~~~~~
a.cc:25:49: error: 'System' was not declared in this scope
   25 |                                                 System.out.print("#");
      |                                                 ^~~~~~
a.cc:32:41: error: 'System' was not declared in this scope
   32 |                                         System.out.println();//?¬??????????
      |                                         ^~~~~~
a.cc:34:33: error: 'System' was not declared in this scope
   34 |                                 System.out.println();//??????
      |                                 ^~~~~~
a.cc:41:26: error: 'IOException' does not name a type
   41 |                 } catch (IOException e) {
      |                          ^~~~~~~~~~~
a.cc:43:25: error: 'e' was not declared in this scope
   43 |                         e.printStackTrace();
      |                         ^