Skip to main content

Featured

Game Development Tutorials In Android

Game Development Tutorials In Android Hi Guys,                 We are shortly started Game Development Tutorials in Android Studio. So everyone supports me and share this blogs to your friends. Guys, At this time everyone is freely available to source code and we are provide a video for step by step game developments. you are learn free and feel free to support us. Guys, if you have any question to me, so feel free to comment us. I will try to answer all the question as long as possible.                                                     Thank's                                                                          ...

Abstract class example program in java

Question : What is Abstract class in JAVA?

Answer : Abstract class is a class that can not be instantiated it's object can not be created! This is because it contain or some method which are abstract or undefined. A class which inherit an abstract class must be define abstract method of the superclass only than the object of subclass can we created, otherwise it's must be declared abstract method of the superclass. 

Example Program : 

abstract class myabstract
{
   abstract void ab1();
   public void ab2()
   {
      System.out.println("Don't forget me I'm inside !!smile!!");
   }
}
class toAbs extends myabstract
{
  void ab1()
  {
     System.out.println("Hello Abstract !!");
  }
  public static void main(String args[])
  {
     myabstract obj = new toAbs();
     obj.ab1();
     obj.ab2();
 }   
}

Save this file : toAbs.java

Compile this file : javac toAbs.java

Run this file : java toAbs

output : 

Hello Abstract !!

Don't forget me I'm inside !!smile!!

If you want to donate money if this information is useful to 
you :

If this information is important to you , and you want to , I will continue writing some more details of programming language, so click on the advertising, available on this page. This is motivate me for writing some more blogs.

Comments