Home / Questions / (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:
Explanatory Question

(a) Name any two basic principles of Object-oriented Programming.

Answer

  1. Encapsulation
  2. Inheritance

(b) Write a difference between unary and binary operator.

(c) Name the keyword which:

  1. indicates that a method has no return type.
  2. 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:

👁 97 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Answer (a)

  1. Encapsulation
  2. Inheritance

Answer (b)

unary operators operate on a single operand whereas binary operators operate on two operands.

Answer (c)

  1. void
  2. static

Answer (d)

  1. short — 2 bytes
  2. float — 4 bytes

Answer (e)

  1. Keyword
  2. Literal
  3. Operator
  4. Separator