Results 1 to 3 of 3
  1. #1
    jhering1986 is offline Member
    Join Date
    Mar 2009
    Posts
    8
    Rep Power
    0

    Default abstract class help

    Alright so basically, I started off with static classes and methods and now I have created an abstract method and in turn have created abstract classes, but I get a cannot be instantiated error on this code:
    Java Code:
    package dog;
    // ****************************************************************
    // DogTest.java
    //
    // A simple test class that creates a Dog and makes it speak.
    //
    // ****************************************************************
    public class DogTest
    {
    public static void main(String[] args)
    {
    dog Dog = new dog("Spike");
    System.out.println(Dog.getName() + " says " + Dog.speak());
    dog labrador = new dog("Bailey");
    System.out.println(labrador.getName() + " says " + labrador.speak());
    dog Yorkshire = new dog("Minnie");
    System.out.println(Yorkshire.getName() + " says " + Yorkshire.speak());
    }
    }

  2. #2
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    You mean that dog class is abstract?

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default

    Follow coding conventions. Class names begin with an uppercase letter, variable and method identifiers with a lowercase letter.
    Code Conventions for the Java(TM) Programming Language: Contents

    Your reversal of these conventions makes your code next to impossible to analyze.

    db

Similar Threads

  1. Replies: 6
    Last Post: 02-11-2009, 10:51 AM
  2. abstract class
    By makpandian in forum New To Java
    Replies: 1
    Last Post: 12-12-2008, 03:11 PM
  3. Abstract class
    By naeem.jamil in forum New To Java
    Replies: 4
    Last Post: 08-26-2008, 05:21 AM
  4. Replies: 0
    Last Post: 04-02-2008, 07:04 AM
  5. Abstract Class
    By gapper in forum New To Java
    Replies: 4
    Last Post: 01-31-2008, 01:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •