Solved

Java abstract class extending abstract class - do I need to declare abstract methods in 2nd abstract class?

Posted on 2007-11-15
4
487 Views
Last Modified: 2012-05-05
Hi,

I'm writing some Java classes and I would like to have the following structure:

abstract class submittedForm

abstract class submittedFormType extends submittedForms

class formA extends submittedFormType

Question:

A: Is this a valid way to design my code with an abstract class extending an abstract class?

B: If I declare an abstract method in submittedForm, can I wait to implement that method in formA, or do I also need to reference that abstract method in the submittedFormType abstract class as well?

Thanksin advance,
Courtenay
0
Comment
Question by:courtenayt
  • 2
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
sciuriware earned 500 total points
Comment Utility
A) valid but may be error prone.
B) not to be repeated in the extended class but implemented in the final class.

;JOOP!
0
 
LVL 1

Author Comment

by:courtenayt
Comment Utility
Thanks!
0
 
LVL 1

Author Closing Comment

by:courtenayt
Comment Utility
fast response
0
 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
:)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now