How To Implement Final Class In Java
Rate this article
0 out of 5
In this tutorial we will show you how to implement final class in java. After viewing the video tutorial, download the source code and try to modify the code so as to get a feel of what is learned in this video tutorial.


Source Code
FinalDemo.java

import java.io.*;
final class A
  {
    int x;
    A(int m)
      {
       x=m;
      }
   }
class B extends A
  {
   int y;
   B(int a,int b)
    {
     super(a);
     y=b;
    }
void display()
 {
  System.out.println(" Implementation of display method in B "+x+" "+y);
 }
 }
class FinalDemo
 {
  public static void main(String args[])
   {
    B b=new B(5,10);
    b.display();
   }
  }


Source Code

About The Author
TekTips Videos

Number Of articles Posted
27
Number Of Messages Posted
0
Joined Date
04/02/2013
   
Author
Messages
Posted:
Post Your Comments
Name (Max 50 Chars)
Comments

 
TekTipsDownload
GateExam
Academic Projects
TekTipsExperts
Android