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 in Java

Abstract Class in Java

In Previous Post, I'll give you the project code for Puzzle Game or Google Mail Sender using core Java, B'coz the reason is I want to show you the magics of Java , but today's we are going to some fundamentals, because this is very important to understand How java is work, where to use abstract, where to use interface etc.... 

Abstract : Abstract class is a class that can not be instantiated , it's object cannot be created , it's contain or some methods are abstract or undefined.

In the Next Example I'll show you only the simple example code, do some googling for definitions to understand abstract, interface, inheritance etc...

Before we are going to make the Simple Abstract Program, Just click on all the advertisement , available on this blog.


Example Code :   

                                  "Abstest.java"

public class Abstest extends Abstractclass{
public static void main(String arg[])
{

Abstractclass ob=new Abstest();
ob.sum();
}

}     

                             "Abstractclass.java"

public abstract class Abstractclass{

public void sum()
{
System.out.println(30);
}


public static void main(String arg[])
{

//Abstractclass ob=new Abstractclass();

}



}

                           "AbstractPen.java"

public abstract class AbstractPen{

public abstract void penprice();
public abstract void penbrand();
public void pencolor()
{
System.out.println("red");
}


}

                              "Abstractsubclass1.java"

abstract public class Abstractsubclass1 extends AbstractPen{

public void penprice()
{
System.out.println(200);
}

}

                             "Abstractsubclass2.java"

public class Abstractsubclass2 extends Abstractsubclass1
{
public void penbrand()
{
System.out.println("Renoylod");
}

public static void main(String arg[])
{

AbstractPen ref=new Abstractsubclass2();
ref.penprice();
ref.penbrand();
ref.pencolor();
}

}


Compile And Run these files...

If this information is important to you , and you want to , I will continue writing some more details of Android Programming Language, so click on the advertising, available on this page. This is motivate me for writing some more useful stuff, Thank's 

Comments