Technical Interview Questions and Answers :: Syntel Inc.
- Select All
- Oracle PLSQL
- Java
- C++
- WebMethod
- C
- DBMS
- Operating System
- Oracle Apps HRMS
- Networking
- Soft. Engineering
- HR Question in TR
- Data Structure
- .NET
- SQL
1 / 161
No Discussion on this question yet!
2 / 161
No Discussion on this question yet!
3 / 161
No Discussion on this question yet!
4 / 161
No Discussion on this question yet!
5 / 161
No Discussion on this question yet!
6 / 161
No Discussion on this question yet!
7 / 161
No Discussion on this question yet!
8 / 161
No Discussion on this question yet!
9 / 161
1. Abstraction
2. Encapsulation
3. Inheritance
4. Polymorphism
5. Classes and Object
10 / 161
Inheritance means, we use the methods or function or other public members of the parent class by child class. So to do this we have to extend the the parent class through it child class.
For Ex:- Amitabh bacchan's fames inherited by his child Abhishek.
Program Ex:-
class A{
print(){
System.out.println("HELLLO ");
}}
class B extends class A{
public static void main(String... args){
A pr=new A();
pr.print();
}}
Things to remember:---
* Every class in java inherited by its parent class Object which is in the package:- java.lang.Object when the class is not extended by any child class only.
* Java does not support "Multiple Inheritance" except in the case of Interface Concept.
Because one class cannot extend more than one class but Interface able to extend more than one.