tuxmartin

PGRF1 - test 1 ctverec

Oct 15th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. // http://krajta.com/?Predmety-FIM-PGRF-testy&p=127640#127640
  2. /* -------------------------------------------------- */
  3. public class Ctverec {
  4.     public double hrana;
  5.    
  6.     public Ctverec(double hrana) {
  7.         // ...
  8.     }
  9.    
  10.     public void draw() {
  11.         // ...
  12.     }
  13. }
  14. /* -------------------------------------------------- */
  15. public class Main {
  16.     public static void main(String[] args) {
  17.  
  18.         Ctverec c1;
  19.         c1 = new Ctverec(7);
  20.         c1.draw();
  21.  
  22.         // nebo:
  23.         Ctverec c2 = new Ctverec(7);
  24.         c2.draw();
  25.  
  26.         // nebo pokud uz dal nepotrebujes referenci na ctverec:
  27.         new Ctverec(7).draw();
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment