Git Product home page Git Product logo

ap-exercise-1's Introduction

ترتیب کلاس ها برای کامل کردن:

  1. Human
  2. Student
  3. Professor
  4. Main
  • کلاس های professor و student از کلاس human ارث بری میکنند.

سوال 1: در کلاس Human متود ()staticPrint را طوری تغییر دهید که خروجی آن در کلاس هایی که کلاس Human را پیاده سازی می کنند قابل تغییر نباشد.

سوال 2: کلاس Student را طوری تغییر دهید که هنگام صدا زدن متود ()sayMyName بر روی آن، مشخصه fullName آن در خروجی چاپ شود.

سوال 3: مشخصه های زیر را با توابع Setter و Getter مناسب به کلاس Student اضافه کنید.

studentNumber, majorName, universityName

سوال 4: مشخصه های زیر را با توابع Setter و Getter مناسب به کلاس Professor اضافه کنید.

professorFaculty, numberOfCourse, professorSpecialty

سوال 5: کلاس Professor را طوری تغییر دهید که هنگام صدا زدن متود ()sayMyName بر روی آن، مشخصه fullName و professorFaculty در خروجی چاپ شود.

سوال 6: بعد از کامل کردن کلاس های Student و Professor یک نمونه از هرکدام بسازید و با استفاده از کلمه کلیدی instanceof چک کنید که آیا این دو نمونه واقعا نمونه ای از کلاس Human هستند یا نه.

سوال 7: کد مقابل را بنویسید.

Human human = new Student();

خروجی ()human.sayMyName چیست؟

سوال 8: حالا این کد را بنویسید.

Human human = new Professor();

خروجی ()human.sayMyName چیست؟

سوال 9: از این دو مثال چه نتیجه ای می توان گرفت؟

ap-exercise-1's People

Contributors

sabamadadi avatar divinehemlock avatar zohakhanlari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.