الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

[مخالف - طلب حل : ]لمحبين التحدي برنامج جافا

مغلق
بدأه kajal في 9 مايو 2010 · 1 رد · 385 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله....

انا عضوة جديدة في منتداكم واريد مساعدتكم :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:

#2

الأخ الكريم/الأخت الكريمة

السلام عليكم ورحمة الله وبركاته.

مرحباً بكم في منتدى الفريق العربي للبرمجة

تأسف إدارة المنتدى لغلق الموضوع وذلك لمخالفته قوانين المشاركات، فقرة طلب حل الواجبات والتمارين.

قواعد طرح المشاركات

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

حزمة المحرك الإصدارة 0.8

أي أحد يجد أني ظلمته فليراسلني

وبإذن الله لو كان له حق سيأخذه

728x90.png

هذا الموضوع مغلق.

مواضيع مشابهة