Java Questions
- What is Operator?
- Answer: Operators are special symbols that perform specific operations on one or multiple operands, and then return a result.
- What are the primitive data types supported by the Java programming language?
- Answer:
The eight primitive data types are supproted by Java Programming Language:
byte - It is 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127.
short - It is a 16-bit signed two's complement integer. It has a minimum value of -32,768 and a maximum value of 32,767.
int - It is a 32-bit signed two's complement integer. It has a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647.
long - It is a 64-bit signed two's complement integer. It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807.
float - It is a single-precision 32-bit IEEE 754 floating point.
double - It is a single-precision 64-bit IEEE 754 floating point
boolean - boolean data type has two possible values: true and false.
char - It is a single 16-bit Unicode character.
- What is an array?
- Answer:
An array is an object that holds a fixed number of values of a single data type.
Specify length of array when array is created. Each item array is called an element. Array element access through index. Array index numbering begins with 0.
- What is Encapsulation?
- Answer: Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data Encapsulation.
- What is package?
- Answer: A package is a namespace that organizes a set of related classes and interfaces.
- What is interface?
- Answer:
An interface is a reference type, similar to a class, that can contain only constants, method signatures, and nested types.
There are no method bodies. Interfaces cannot be instantiated - they can only be implemented by classes or extended by other interfaces.
- What is Class?
- Answer: A class is a prototype from which object is created.
- What are the benefit of Object?
- Answer:
Modularity - an object can be written and maintained independently from the source code of other objects.
Information-hiding - only interact with object's methods. Details of object remains hidden.
Code reuseability
Last Date: 21 December, 2017
Last Date: 16 May, 2017
Last Date: 06 March, 2017
Last Date: 10 April, 2015
Last Date: 10 April, 2015