السلام عليكم ورحمة الله....
انا عضوة جديدة في منتداكم واريد مساعدتكم :blush:
عندي برنامج جافا ماقدرت اعمله واتمنى مساعدتكم فيه وهو كتابة كود:
[
Write a JAVA program in which you are required to define a class named Citizen. The class must include the following two data members
1: Name // data member for Citizen Name
2: Nationality //data member for Citizen Nationality
Your Program should two constructors for the class Citizen
1: a constructor with no parameter
2: a constructor with two parameters (name, nationality)
Both constructors are meant to initialize their respective objects. Declare two objects (1 for each type of constructor) in main. Write a function in class Citizen to display the initialized data members for each object. Display a message that says “Constructor called” in the Constructor body.
OUTPUT:
Your output should be similar to the following
Olien
Australian
_________________
Mark
Australian
_________________
Where;
Olien
Australian
are the initialized against the constructor with no parameters.
Mark
Australian
are the initialized values against the constructor with two parameters
والله يجزى اللي يساعدني الف خير :unsure:
