Home > Technical Interviews > Computer Science & Engineering > Java Programming > Core Questions and Answers
66. | When can an object reference be cast to an interface reference? |
An object reference be cast to an interface reference when the object implements the referenced interface. |
67. | Which class is extended by all other classes? |
The Object class is extended by all other classes. |
68. | Which non-Unicode letter characters may be used as the first character of an identifier? |
The non-Unicode letter characters $ and _ may appear as the first character of an identifier |
69. | What restrictions are placed on method overloading? |
Two methods may not have the same name and argument list but different return types. |
70. | What is casting? |
There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference. |