Advertisement
kk258966

4/8 物件導向程式設計 練習三

Apr 8th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. class CRectangle
  2. {
  3.     int width;
  4.     int height;
  5. }
  6.  
  7. public class B10207081_2
  8. {
  9.     public static void main(String args[])
  10.     {
  11.         CRectangle rect5;
  12.         rect5=new CRectangle();
  13.        
  14.         rect5.width=30;
  15.         rect5.height=20;
  16.        
  17.         System.out.println("width="+rect5.width);
  18.         System.out.println("height="+rect5.height);
  19.         System.out.println("B10207081");
  20.        
  21.     }
  22.    
  23.              
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement