[
center]السلام عليكم :)
ممكن مساعده على توضيح بعض النقط الانه أشكاليه على
الانه أنا ممبتدى فى الغه الجافه ورايد المساعده
وشكرا............. :wub:
Creation of JAVA Programs
A JAVA program is created with any text editor (for example, WordPad, eclipse, emacs,
vi, etc). JAVA programs get the file name extension .java. These program sources are
converted by a compiler (javac) into an executable format. These files have the filename
extension .class and represent the program as a compact, so-called bytecode. .class files
can be executed by the Java interpreter (virtual machine).
For different platforms, different Java compiler and interpreter (Linux, Unix, Windows,
etc) are available. Select the appropriate compiler/interpreter, download them and install
them on your platform. Commands
Java compiler: javac hello.java
JAVA interpreter: java hello (NOT java hello.class)
Java Program Structure
A "compilation unit" is a file, e.g., hello.java. Each JAVA "compilation unit" contains
exactly one public class (public) and further non-public classes. The name of the public
class determines the file name.
The Environment Variable CLASSPATH
When a Java program is running, it uses during the processing parts of the Java system
library may parts of other libraries and the programs developed in JAVA. Any of those
files are accessed dynamically. In the environment variable CLASSPATH is a list of
directories stored (separated by semicolons ”;” in Windows or colons ”:” in UNIX), in
which the Java interpreter looks after all of these classes.
IP Assignment 1 2/2
Libraries may be combined as a compressed files (*. zip), and should appear in this list.
Initialization
· Start a shell or DOS prompt
· Create in your home directory a subdirectory called java, in which all source
programs (. java) will be stored.
· Adjust your CLASSPATH to, so for example
Linux
setenv CLASSPATH $CLASSPATH:.:$HOME/java
or DOS
set CLASSPATH=%CLASSPATH%;.;Z:\java
First Java Program: hello world
· Familiarize yourself with the creation of a Java program and its implementation,
using examples from the lecture. Use the tools (editor, java and javac)
· Carry out the steps described in the lecture to your own computer:
1. Type the program
2. Compile the program
3. Execute the program.
Assignment (You are required to only submit your solution to this assignment)
Please model, in a simple way and using object-oriented techniques, a bank and its
customers (private, not business):
· Model the class inheritance hierarchy: Account, CheckingAccount,
SavingAccount, and SuperSavingAccount.
· Model the Customer class
· Think about the most important attributes and methods for each class.
· Explain the relationships between the different classes.
· Return the class diagram as part of the solution!
Now implement these classes in Java. Comment the code well and submit the source
code as well as the binaries as part of the solution!
Please be aware that the code developed here will be used in the future assignments
during the course and that no solutions will be provided to you.
