Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1.  
  2. class SinsaApt2{
  3. int floorCount;
  4. int parkingLotCount1;
  5. int parkingLotCount2;
  6. int elevatorCount;
  7. //gtpc
  8. int getTotalParkingCount(){
  9. return parkingLotCount1+parkingLotCount2;
  10. }
  11. }
  12.  
  13. public class OOP2 {
  14. public static void main(String[] args) {
  15. SinsaApt2 apt2001 = new SinsaApt2();
  16. apt2001.floorCount = 20;
  17. apt2001.parkingLotCount1 = 15;
  18. apt2001.parkingLotCount2 = 20;
  19. apt2001.elevatorCount=1;
  20.  
  21. System.out.println("2001동의 총 주차대수: " + apt2001.getTotalParkingCount());
  22. System.out.println("2001동의 첫 번째 주차대수: " + apt2001.parkingLotCount1);
  23. System.out.println("2001동의 두 번째 주차대수: " + apt2001.parkingLotCount2);
  24. System.out.println("\n2001동의 첫 번째 주차대수 현황: 주차장1 = " + apt2001.parkingLotCount1+", 주차장2 = "+apt2001.parkingLotCount2);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement