System.out.println("\033[30m"+"Hello World 设置m为:30"+"\033[m"); System.out.println("\033[31m"+"Hello World 设置m为:31"+"\033[m"); System.out.println("\033[32m"+"Hello World 设置m为:32"+"\033[m"); System.out.println("\033[33m"+"Hello World 设置m为:33"+"\033[m"); System.out.println("\033[34m"+"Hello World 设置m为:34"+"\033[m"); System.out.println("\033[35m"+"Hello World 设置m为:35"+"\033[m"); System.out.println("\033[36m"+"Hello World 设置m为:36"+"\033[m"); System.out.println("\033[37m"+"Hello World 设置m为:37"+"\033[m"); System.out.println("\033[38m"+"Hello World 设置m为:38"+"\033[m"); System.out.println("\033[39m"+"Hello World 设置m为:39"+"\033[m"); System.out.println("\033[40m"+"Hello World 设置m为:40"+"\033[m"); System.out.println("\033[41m"+"Hello World 设置m为:41"+"\033[m"); System.out.println("\033[42m"+"Hello World 设置m为:42"+"\033[m"); System.out.println("\033[43m"+"Hello World 设置m为:43"+"\033[m"); System.out.println("\033[44m"+"Hello World 设置m为:44"+"\033[m"); System.out.println("\033[45m"+"Hello World 设置m为:45"+"\033[m"); System.out.println("\033[46m"+"Hello World 设置m为:46"+"\033[m"); System.out.println("\033[47m"+"Hello World 设置m为:47"+"\033[m");
样式
其实,并不用特别的去记什么数字代表什么样式,用一个for循环输出看看就可以知道了
1 2 3
for(int i=0;i<99;i++) { System.out.println("\033["+i+"m" + "Hello World 设置m为:"+i+ "\033[m"); }
暂无评论