课程: Java Object-Oriented Programming
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Challenge: Build an employee class
(bright upbeat music) - [Instructor] It's time to practice representing objects in code by creating an employee with Java. In this challenge, you'll represent an employee in Java by creating an employee class. The class should have attributes for the employee's name, age, salary and location. Feel free to get creative and add more attributes if you'd like. The employee class should also have a raise behavior that raises the employee's salary. Whether this behavior has a parameter or not is up to you. As a part of this challenge you'll have to determine which members if any, should be static versus non-static. Once you've created your employee class you should create another class for building your employee instances. In the main function of the main class create at least two employees and give one employee a raise then print out the salaries of both employees to ensure the raise took effect. Good luck and have fun.
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
(已锁定)
Using classes as blueprints4 分钟
-
(已锁定)
Building objects with a constructor2 分钟 48 秒
-
(已锁定)
Using concrete instances for application logic4 分钟 32 秒
-
(已锁定)
Understanding the difference between class and instance members4 分钟 54 秒
-
(已锁定)
Exploring a built-in Java class4 分钟 5 秒
-
(已锁定)
Challenge: Build an employee class1 分钟 8 秒
-
(已锁定)
Solution: Build an employee class3 分钟 11 秒
-
(已锁定)
-
-
-
-
-