1
(a) Name any two basic principles of Object-oriented Programming.
Show SolutionHide Solution↓
- Encapsulation
- Inheritance
(b) Write a difference between unary and binary operator.
unary operators operate on a single operand whereas binary operators operate on two operands.
(c) Name the keyword which:
- indicates that a method has no return type.
- makes the variable as a class variable
- void
- static
(d) Write the memory capacity (storage size) of short and float data type in bytes.
- short — 2 bytes
- float — 4 bytes
(e) Identify and name the following tokens:
- public
- 'a'
- ==
- { }
- Keyword
- Literal
- Operator
- Separator