Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class JavaTesting1601
- {
- class Monitor
- {
- Monitor()
- {
- System.out.println("Wywolano domyslny");
- }
- Monitor(int szerokosc,int wysokosc)
- {
- System.out.println("wywolano parametryczny");
- }
- public double dodaj(double x, double y)
- {
- double wynik = 0;
- wynik = x + y;
- return wynik;
- }
- }
- public static void main(String[] args)
- {
- Monitor a = new Monitor(10, 15); // WYJEBUJE ERROR XD
- Monitor a1 = new Monitor(); //WYJEBUJE ERROR XD
- a.dodaj(5, 6);
- a1.dodaj(10,20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement