Interview question


Java Encapsulation Interview Questions


Download 83.98 Kb.
Pdf ko'rish
bet3/3
Sana15.01.2023
Hajmi83.98 Kb.
#1093698
1   2   3
Bog'liq
Interview question

Java Encapsulation Interview Questions
1.
What is the advantage of Encapsulation?
- Encapsulated code ko’proq moslashuvchan va yangi talablar bo’lib
qolsa uni o’zgartirish ancha oson
- U boshqa class larning uning private fieldlariga to’g’ridan- to’g’ri
murojat qilishini oldini oladi
- U ma’lumotlarni va kodni tashqi voris olingan klasslardan saqlaydi.
Bu bilan biz xavfsizlikka erishamiz
- U dasturning barqarorligini oshiradi
2. What is the difference between Abstraction and Encapsulation?
- Abstraction solves the problem at the design level whereas
encapsulation solves the problem at the implementation level
- Abstractionga interface va abstract class lar orqali, Encapsulationga
esa private va protected modifer lar orqali erishiladi
- Abstraction is used to hide the unwanted data and giving relevant
data whereas encapsulation is used for hiding data and code in a
single unit to prevent access from outside.
3. What is Object Based Programming language?
OOP ga asoslangan lekin Polimorfizm va Inheritanceni qo’llamaydi.
JavaScript - OBP
4. What are the advantages/benefits of OOPs in Java?
- Security
- Reusablity(qayta ishlatsa bo’ladigan)
- Effective communication(effectiv aloqa)
- Developing complex software(murakkab dastur tuzish)
- Easy upgraded(Oson o’zgartirsa bo’ladigan)
- Easy partition of work(Ishni oson bo’lish)
- Maintenance
- Efficency
5. How Java compiler differentiate overloaded methods?


Java overload methodlarni faqat signaturasi orqali ajratib oladi. Ya’ni
nomi va parametrlar ro’yxati orqali. Return type bunda hech qanday
ro’l o’ynamaydi

Download 83.98 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling