Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Employee {
- String firstName;
- String lastName;
- double salary;
- double bonus;
- void printTotalSalary() {
- double totalSalary = salary + bonus;
- String message = "Całkowita wypłata: " + totalSalary;
- System.out.println(message);
- }
- }
- class Company {
- public static void main(String[] args) {
- Employee emp = new Employee();
- emp.firstName = "Jan";
- emp.lastName = "Kowalski";
- emp.salary = 5000;
- emp.bonus = 500;
- emp.printTotalSalary();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement