Friday 23 September 2016

Java Important interview Questions :

Q: what is the difference between an interface and an abstract class?
A: An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private,protected,etc), but has some abstract methods.
What is java
1.Java is a Programming language. java is high level secured object-oriented programming language.
2.Java is platform. platform is nothing but any hardware & software environment in which a program runs is called Platform.
3.Java has its own runtime environment and API.
Sample Program:
Class Hi
{
public static void main (String args[])
{
System.out.println("Hi Java");
}
}