A Guide To Advanced Java - Reflection pdf

1 262 0
A Guide To Advanced Java - Reflection pdf

Đang tải... (xem toàn văn)

Thông tin tài liệu

A Guide To Advanced Java Assignments © 2007 Aptech Ltd Version 1.0 Page 1 of 1 R R e e f f l l e e c c t t i i o o n n Sr. No Assignment Question 1. Case Study: The management of the Global Investors Bank is looking at automation as a means to save time and effort required in their work. In order to achieve this, the management has planned to computerize the regular banking transactions. The CEO of the company and a team of experts have chosen Atlantis Software to provide a solution for the same. As a senior developer, you are required to develop an application using the Reflection API to examine the instance variables, methods of the classes developed by the junior developers at runtime. The application consists of the following classes. 1. UserAccount.java 2. Bank.java 3. BankTest.java Each class has a specific purpose and functionality. The descriptions of each class are as follows. UserAccount.java The Account class represents an actual bank account. It stores the following details of a bank account. • accountNumber • firstName • lastName • accountBalance • password Each of the instance variables have been declared as private and getter/setter methods have been defined for them. The Account class will be used by the Bank class to create bank accounts. ValidateUserAccount.java The ValidateUserAccount class is a java main class used to test the UserAccount class. It creates an instance of the UserAccount class and examines its fields and methods at runtime. The ValidateUserAccount class defines the following methods to use for validation. • static void printFieldInformation(UserAccount objAccount): This method is invoked to retrieve and display the current field values and their modifiers. • static Object createObject(Constructor constructor, Object[] arguments): This method is invoked to create an instance of the class using the parameterized constructor. • Static void setFieldValues(UserAcount objAccount): This method is invoked to set some values to the UserAccount instance. . UserAccount .java 2. Bank .java 3. BankTest .java Each class has a specific purpose and functionality. The descriptions of each class are as follows. UserAccount .java The Account class represents an. ValidateUserAccount class is a java main class used to test the UserAccount class. It creates an instance of the UserAccount class and examines its fields and methods at runtime. The ValidateUserAccount. represents an actual bank account. It stores the following details of a bank account. • accountNumber • firstName • lastName • accountBalance • password Each of the instance variables have been

Ngày đăng: 02/08/2014, 08:21

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan