Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
 
import static java.lang.Integer.parseInt;
 
/**
 * <pre>
 * ??????????????????
 * </pre>
 *
 * @author ?????????????????§???
 * @version 1.8_45
 * @since 1.8_45
 */
public class Main {
 
    public static void main(String[] args) throws IOException {
        
		// ?????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// 1?????????????????????????????????????§????????????????????????°
		int data_set = Integer.parseInt(br.readLine());
		// ??\?????????????????????????????????????????£?¨?
		String tmp_row;

		while ((tmp_row = br.readLine()) != null && !tmp_row.isEmpty()) {
			String[] tmp_line = tmp_row.split(" ");
			// ??????????????????
			int map_height = Integer.parseInt(tmp_line[0]);
			// ???????????????
			int map_width = Integer.parseInt(tmp_line[1]);
			// ????????¨???????????£?????????????????????
			String[][] game_Map = new String[map_height + 2][map_width + 2];
			// ?????????????????????????????±???????´???´???
			Tank tank = null;

			// ??°????????????????£?????????????
			for (int wall = 0; wall < map_height + 2; wall++) {
				Arrays.fill(game_Map[wall], "W");
			}

			// ????????????????????°??¢?????\????????????
			for (int mh = 1; mh < map_height + 1; mh++) {
				tmp_row = br.readLine();
				for (int mw = 0; mw < map_width; mw++) {
					// ??°??????????£?
					game_Map[mh][mw + 1] = String.valueOf(tmp_row.charAt(mw));

					// ????????????????????±????????????????´?
					// ???????????????????????°????????????
					if ("^v<>".indexOf(game_Map[mh][mw + 1]) > -1) {
						// init tank.
						tank = new Tank(game_Map, game_Map[mh][mw + 1], new int[] { mh, mw + 1 });
						game_Map[mh][mw + 1] = ".";
					}
				}
			}

			br.readLine();
			// ?????????????????????
			tmp_row = br.readLine();
			for (char cmd : tmp_row.toCharArray()) tank.command(cmd);
			//????????????????????????????????±?????¨?¨???????
			tank.last_tankLocate();
			data_set--;

			// ??°??¢?????????
			// ???????????????????????°????????????
			for (int ch = 1; ch < map_height + 1; ch++) {
				for (int cw = 1; cw < map_width + 1; cw++) {
					System.out.print(game_Map[ch][cw]);
				}
				System.out.println();
			}
			if (data_set > 0)
				System.out.println();
		} // while?????????????????????
	}// ?????????????????????????????????
}// ???????????????????????????????????????
 
class Tank {
 
    /*
	 * ?§??????????
	 */
	static HashMap<String, String> move_Cmd = new HashMap<String, String>() {
		{
			put("U", "^");
			put("D", "v");
			put("L", "<");
			put("R", ">");
		}
	};
   /*
	 * ?§??????¢???
	 */
	static HashMap<String, int[]> move_Dir = new HashMap<String, int[]>() {
		{
			put("^", new int[] { -1, 0 });
			put("v", new int[] { 1, 0 });
			put("<", new int[] { 0, -1 });
			put(">", new int[] { 0, 1 });
		}
	};
 
   /**
	 * ?????????
	 */
	private String[][] map;
	/**
	 * ??????????????¨??°
	 */
	private int[] pos;
	/**
	 * ??????
	 */
	private String dir;

	/*
	 * ????????????????????????
	 */
	Tank(String[][] game_Map, String tank_dir, int[] tank_pos) {
		this.map = game_Map;
		this.pos = tank_pos;
		this.dir = tank_dir;
	}

 
   // ???????????????????????°????????????
	void command(char cmd) {

		if (cmd != 'S') {
			move_tank(String.valueOf(cmd));
		} else {
			cannon_Shot();
		}
	}
 
    /**
	 * <pre>
	 *?????????????§????
	 *
	 *???????????°???????§??????????
	 *???????????¬??????????????????????????£????§???????????????¨?????????
	 * </pre>
	 *
	 * @param cmd
	 *            ?????¬??????????????????
	 * @param move
	 *            ??????????§????
	 */
	private void move_tank(String cmd) {
       this.dir = move_Cmd.get(cmd);
		int[] move = new int[] { this.pos[0], this.pos[1] };
		move[0] += move_Dir.get(this.dir)[0];
		move[1] += move_Dir.get(this.dir)[1];
		if (map[move[0]][move[1]] == ".") {
			this.pos[0] = move[0];
			this.pos[1] = move[1];
		}
	}// move_tank????????????????????????
 
    /**
	 * <pre>
	 * ?????????????????????
	 * ????????¬?????¬????£??????¶????????£???????????°?????????
	 * ?????????????£??????°?????????
	 * ????????°??????????????¨??§?????£????????????????¶????
	 * </pre>
	 *
	 * @param shell
	 *            ??????
	 */
	private void cannon_Shot() {
        int[] shell = new int[] { this.pos[0], this.pos[1] };
		while (true) {
			shell[0] += move_Dir.get(this.dir)[0];
			shell[1] += move_Dir.get(this.dir)[1];
			switch (map[shell[0]][shell[1]]) {
			case ".":
			case "-":
				continue;
			case "*":
				map[shell[0]][shell[1]] = ".";
			case "#":
			case "W":
			}
			break;
		}
        }
    }// cannon_Shoot????????????????????????
 
    void last_tankLocate() {
// ?????????????????¨??°?????°????????¨?¨???????
        map[this.pos[0]][this.pos[1]] = this.dir;
    }
 
}// Tank?????????????????????

Compiler output:
Main.java:196: error: unnamed classes are a preview feature and are disabled by default.
    void last_tankLocate() {
    ^
  (use --enable-preview to enable unnamed classes)
Main.java:201: error: class, interface, enum, or record expected
}// Tank?????????????????????
^
2 errors