(a) Name any two basic principles of Object-oriented Programming.
Answer
- Encapsulation
- Inheritance
(b) Write a difference between unary and binary operator.
(c) Name the keyword which:
- indicates that a method has no return type.
- makes the variable as a class variable
(d) Write the memory capacity (storage size) of short and float data type in bytes.
(e) Identify and name the following tokens:
Single Choice
Views 90
Answer:
Answer (a)
- Encapsulation
- Inheritance
Answer (b)
unary operators operate on a single operand whereas binary operators operate on two operands.
Answer (c)
- void
- static
Answer (d)
- short — 2 bytes
- float — 4 bytes
Answer (e)
- Keyword
- Literal
- Operator
- Separator
Related Articles:
This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.
Join Our telegram group to ask Questions
Click below button to join our groups.