[JAVA]

java:superHello.HelloJava.java


/** @author Ryome */
/**
 *-*/
package superHello;

import java.util.Arrays;
class HelloException extends Exception{private static final long serialVersionUID=1L;HelloException(String m){super(m);}}
interface SuperHelloWorld {public abstract String SuperHello() throws HelloException;}
abstract class Hello implements SuperHelloWorld{final String HELLO="Helloworld";private String hello;
Hello(){this.hello=HELLO;}Hello(String hello){this.hello=hello;}public abstract String SuperHello() throws HelloException;
public String getHello(){return hello;}}
class HelloWorld extends Hello {HelloWorld(){super();}@Override public String SuperHello() throws HelloException{return getHello();}}
public class HelloJava{
    /**1. Alles über Java-Programmierung Alles über Java-Programmierung (Kapselung, Vererbung, Polymorphismus, Schnittstelle, Überladung, Überschreibung, Liste, Trycatch, Ausnahme, Javadoc) Hauptmethode@param args nicht verwendet*/
	public static void main(String[] args){
		try {Arrays.asList(new HelloWorld().SuperHello()).forEach(System.out::println);}catch(HelloException e){}finally{}
	}
}

--Kopieren Sie die obige Anweisung, geben Sie "S-JIS" als Zeichencode an, speichern Sie den Ordnernamen als "superHello" -Dateinamen als "HelloJava.java" und führen Sie ihn aus. ↓ ↓ Javaの全ての結果.png

2. Verwandte

Recommended Posts