GSculerlor

MyClass

Oct 12th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. package OverloadOverride;
  2.  
  3. public class MyClass {
  4.      int height;  
  5.      MyClass() {  
  6.         System.out.println("bricks");  
  7.         height = 0;  
  8.      }  
  9.      MyClass(int i) {  
  10.          System.out.println("Building new House that is "  
  11.               + i + " feet tall");  
  12.          height = i;  
  13.      }  
  14.      void info() {  
  15.          System.out.println("House is " + height  
  16.                  + " feet tall");  
  17.      }  
  18.      void info(String s) {  
  19.          System.out.println(s + ": House is "  
  20.                  + height + " feet tall");  
  21.      }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment