Results 1 to 3 of 3
Thread: abstract class help
- 03-24-2009, 10:18 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 8
- Rep Power
- 0
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()); } }
- 03-25-2009, 05:15 AM #2
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
You mean that dog class is abstract?
- 03-25-2009, 08:18 AM #3
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
-
Difference between Abstract class having only abstract method and a Interface class
By Santoshbk in forum New To JavaReplies: 6Last Post: 02-11-2009, 10:51 AM -
abstract class
By makpandian in forum New To JavaReplies: 1Last Post: 12-12-2008, 03:11 PM -
Abstract class
By naeem.jamil in forum New To JavaReplies: 4Last Post: 08-26-2008, 05:21 AM -
what is the Priority for execution of Interface class and a Abstract class
By Santoshbk in forum Advanced JavaReplies: 0Last Post: 04-02-2008, 07:04 AM -
Abstract Class
By gapper in forum New To JavaReplies: 4Last Post: 01-31-2008, 01:25 PM


LinkBack URL
About LinkBacks

Bookmarks