Java Programming

Get the collection of Java Programs.J2SE

Tuesday, 10 June 2014

Small example of Interface.

interface A
{
int a=10;
void show();
}
class Interface implements A
{
public void show()
{
System.out.println("Show in class");
}
public static void main(String...args)
{
A i = new Interface();
i.show();
}
}
Posted by Krishna Kumar at 11:56
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Search This Blog

Blog Archive

  • ►  2024 (1)
    • ►  September (1)
  • ▼  2014 (28)
    • ►  July (3)
    • ▼  June (25)
      • Sorting A 2D matrix.
      • Printing Pascal Triangle.
      • Small example of Interface.
      • Example to prove that static each class object has...
      • Inheriting Abstract Class and overriding their met...
      • Calculator By inheritance.
      • Function Overloading
      • Find area by taking their dimensions through comma...
      • Find reverse of a number
      • Pattern Printing
      • Constructor Chaining.
      • Use of SUPER keyword to invoke the constructor of ...
      • Print first 10 numbers from fibonacci series.
      • Factorial using recursion.
      • Program to find first 5 Armstrong Numbers.
      • Find whether a number is Prime or not.
      • Finding Grades of Students by after taking input f...
      • Using Scanner class to take input from user and fi...
      • Dynamic Dispatch
      • Use Of FINAL keyword
      • Inheritance Example
      • Function Overloading
      • This & Super - Use
      • Typecasting Example
      • JAVA-Intro

About Me

My photo
Krishna Kumar
View my complete profile
Simple theme. Theme images by gaffera. Powered by Blogger.