Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

abstract method in lab 4?

3462211May 25 2017 — edited Jun 1 2017

Hi Nick,

I have 2 more questions regarding lab 4.  I guess I don't quite comprehend your code.

1) In "Account.java"

public  abstract  String  getAccountType();

Is above line of code "getAccounType()" an abstract method you mentioned in the video/slides?

If it is, what's the point of declare a method without performing any function?

2) In both "CheckingAccount.java" and "SavingsAccount.java"

What's the point of declare "getAccountType()" method in abstract Account class when both CheckingAccount and SavingsAccount declare their own method without using "super" keyword?

public  String  getAccountType() {

     return  accountType;

}; 

Thanks,

Carol

Comments

morgalr

That is a lot of code to go through, so I am not.

Let me ask you this:  I see you have a portion that is marked as recursive, do you recursively call the loading of the images?  If you do therein is your problem.

RuGI:.

Have you tried to define your Layout at  level of the class as static attribute?
You only require one.


Each time you use a BufferedImage, after painting the image invokes flush


picture.flush();

picture = null;

---

RuGI

Max8090-JavaNet

Thanx for the answer.

Can you tell me, which lines are recursive?

It was not my intent to do a recursive call. If so, this could maybe the problem.

Max8090-JavaNet

Yes, but didn't help.

Max8090-JavaNet

The problem is solved. I don't use the class OverlayLayout anymore. The layout looks quite different, but now it works.

1 - 5

Post Details

Added on May 25 2017
7 comments
434 views