Advertisement
Ramdan51-062

MyClass

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