Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author ja
- */
- public class Main {
- static class Prostokat
- {
- private int wysokosc, szerokosc;
- public Prostokat(int wysokosc, int szerokosc)
- {
- this.wysokosc = wysokosc;
- this.szerokosc = szerokosc;
- System.out.println(this);
- }
- public String toString()
- {
- return "Wysokosc = " + wysokosc + " " + "Szerokosc = " + szerokosc;
- }
- }
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Prostokat p1 = new Prostokat(3,5);
- Prostokat p2 = new Prostokat(4,9);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement