New Member FAQ | Forums | Earn Revenue | Posting Guidelines | Help Topics | Admissions 2013
Awards & Gifts
 
Login Login    Register      

ArticlesPractice TestsAsk ExpertsQuestion PapersJobsUniversitiesCollegesCoursesSchoolsTraining

Active Members
TodayLast 7 Daysmore...

Join our online Google+ community for Bloggers, Content Writers and Webmasters




Java program to create an abstract class


Posted Date:     Total Responses: 0    Posted By: Sunil Reddy   Member Level: Platinum   Points/Cash: 2   


import java.lang.*;
abstract class Shape
{
abstract void numberOfSides();
}
class Traingle extends Shape
{
public void numberOfSides()
{
System.out.println("three");
}
}
class Trapezoid extends Shape
{
public void numberOfSides()
{
System.out.println("four");
}
}
class Hexagon extends Shape
{
public void numberOfSides()
{
System.out.println("six");
}
}
public class Sides
{
public static void main(String arg[])
{
Traingle T=new Traingle();
Trapezoid Ta=new Trapezoid();
Hexagon H=new Hexagon();
T.numberOfSides();
Ta.numberOfSides();
H.numberOfSides();


Project Feedbacks


No feedbacks found. Be the first to respond...

Post Feedback
You must Sign In to post a feedback.
Next Project: Java program that allows the user to draw lines,rectangles and ovals
Previous Project: C program, using pointer for string comparison

Return to Project Index

Post New Project


Related Projects

Subscribe to Email
  • Get Jobs by Email
  • Forum posts by Email
  • Articles by Email
  • Online Membersratna
    Venkiteswaran.
    stylus
    alex thomas
    saurabh
    Alice
    skde
    Suman Sinha
    Ramprasad
    More...


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    AdSense Revenue Sharing sites   Advertise   Talk to Tony John
    ISC Technologies, Kochi - India. Copyright © All Rights Reserved.