자바 프로그래밍/코딩15 EmployeeTest.java class Employee { private String name; private String id; static private int count = 0; public Employee(String name, String id) { this.name = name; this.id = id; count++; } public double earnings() { return 0; } public String toString() { return name + "(" + id + ")"; } public static int getCount() { return count; } } class SalariedEmployee extends Employee { private double monthlySalary; public .. 2023. 6. 9. DateTest class Date { private int month; private int day; private int year; public Date(int month, int day, int year) { this.month = checkMonth(month); this.year = year; this.day = checkDay(day); } private int checkMonth(int testMonth) { if (testMonth >= 1 && testMonth 0 && testDay daysPerMonth[month]) { day = 1; month++; if (month > 12) { month = 1; year++; } if (month == 2 && day == 29 && (year % 400 =.. 2023. 6. 8. 9-weeks BankAccount import java.util.Scanner; public class BankAccount{ private double balance; public BankAccount(double initialBalance){ if(initialBalance > 0.0) balance = initialBalance; } public void credit(double amount){ balance += amount; } public double getBalance(){ return balance; } public static void main(String[] args){ BankAccount account1 = new BankAccount(50.00); BankAccount account2 = ne.. 2023. 6. 7. 8-weeks ArrayException public class ArrayException{ public static void main(String[] args){ int[] intArray = new int[5]; intArray[0] = 0; try { for(int i=0; i 2023. 6. 7. 이전 1 2 3 4 다음