Saturday, October 8, 2016

Java interview questions

what is java ?
java is programing language feature which help us to mack object oriented programs with platform independence
we can make any type of application like web application stand- alone application it support lots of feature like
simple robust platform independent etc
what is oops ?
oops specification is object oriented programing
The feature of oops are :
1 object
2 class
3 inheritance
4 polymorphism
5 abstraction
6 encapsulation

what is polymorphsim in java ?
what is polymorphsim ?
to do ability to do more then one task is know as ploymorphsim
we can achieve this in java by using method Overloading and method overriding
Method overloading ?
multiple methods in class with same name but different parameter is know as method overloading !!
1 method have same name
2 parameter should be different by number or by type
3 return type may be same or different
it is used to enhance readability of program
we can use any type of scope and exception in this

 

Java


What is java

Java is platform independent because when we Mack java code first it is know as source code as Student.java . we save java source code with .java extension Then we compiled that cod by using “javac” that check all syntax . and generate . .class file . this .class file run using “java “ interpreter , .class file know as java byte code that is platform independent We can save java program with any name and compile it but after compilation it .class file which name is used in class . so it is good to save java program with its class name JDK &JRE developer have both but customer have jre only for run that byte code or program as some mobile are java supported means they have jre which is help to run java program 1. What is oops? Oops is a programming technique, in oops everything treat as object

The basic factor of oops are:

 1 Abstraction
 2 Encapsulation
 3 Polymorphism
 4 Inheritance

What is encapsulation?

Binding (or wrapping) code and data together into a single unit is known as encapsulation Encapsulation is a technique used for hiding the properties and behaviors of an object and allowing outside access only as appropriate. It prevents other objects from directly altering or accessing the properties or methods of the encapsulated object
==========================================================================