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.
- */
- package javaapplication21;
- /**
- *
- * @author Admin
- */
- public class Test {
- // main + tab
- public static void main(String[] args) {
- // Square
- Square q1; // q1 - переменная типа Square
- Square q2;
- // new - оператор для создания объекта
- Square q3 = new Square(10, 10, 100);
- Square q4 = new Square(10, 10, 100);
- Square q5 = new Square(100, 100, 200);
- // используем методы класса Square
- int x1 = q3.getX();
- System.out.println("x1=" + x1);
- // выводи инф-ю для объекта q5
- System.out.println("q5.x1=" + q5.getX());
- System.out.println("q5.y1=" + q5.getY());
- System.out.println("q5.a=" + q5.getA());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement