Advertisement
Guest User

xd

a guest
Jan 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public class JavaTesting1601
  2. {
  3. class Monitor
  4. {
  5. Monitor()
  6. {
  7. System.out.println("Wywolano domyslny");
  8. }
  9. Monitor(int szerokosc,int wysokosc)
  10. {
  11. System.out.println("wywolano parametryczny");
  12. }
  13. public double dodaj(double x, double y)
  14. {
  15. double wynik = 0;
  16. wynik = x + y;
  17. return wynik;
  18. }
  19. }
  20.  
  21. public static void main(String[] args)
  22. {
  23. Monitor a = new Monitor(10, 15); // WYJEBUJE ERROR XD
  24. Monitor a1 = new Monitor(); //WYJEBUJE ERROR XD
  25. a.dodaj(5, 6);
  26. a1.dodaj(10,20);
  27.  
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement