(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:

Single Choice
Views 90

Answer:

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

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.