SHARE
TWEET

Untitled

a guest May 22nd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class SampleExtendsOverload {
  2.  
  3.     public static void main(String[] args) {
  4.         // TODO 自動生成されたメソッド・スタブ
  5.         Sub obj = new Sub();
  6.     }
  7.  
  8. }
  9.  
  10. class Super {
  11.     Super(String name) {};
  12.     //コメントを外さないとエラーになる 
  13.     //Super(){ System.out.println("Super コンストラクタ");}
  14. }
  15.  
  16. class Sub extends Super{   
  17.     Sub() { System.out.println("sub コンストラクタ");}
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top