helloworld.java

来自「我在学习JAVA的讲义」· Java 代码 · 共 22 行

JAVA
22
字号

public class HelloWorld{
		public static void main(String args[ ]){
			int i=0;
			String greetings[ ]={ "Hello World!","Hello!",
				"HELLO WORLD!!"};
			while ( i<4){
				
		      try {
					System.out.println(greetings[i]);
		      }catch(ArrayIndexOutOfBoundsException e){
			  System.out.println("Re-setting Index Value");
			//  i=-1;
		   }finally{
			System.out.println("This is always printed");
		   }

				i++;
			}
		}
	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?