Skip to content
Advertisement

Tag: oop

OOP Hello World in Java [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 3 years ago. Improve this question This is My 1st OOP app I Import all the bellow things but

I have an enum, but i dont know how can I use correctly?

I searched so long for what enums are useful. In my Opinion there are Variables with many keywords. So have to programming a program what Is used to manage a bank. My Enum has 2 Variables EINZAHLUNG(Deposit) and AUSZAHLUNG(Payout). So I have an class Menue which is provide to call the Methods. The menue would be chosen by an UserInput.

Replacing if else statement with pattern

I have a if else statement which might grow in the near future. Since, this is already looking messy, I think it would be better if I can apply any design patterns here. I looked into Strategy pattern but I am not sure if that will reduce if else condition here. Any suggestions? Answer This is a classic Replace Condition

The object-oriented approach to a many-to-many relationship

I’m battling at the moment in trying to understand how to approach this issue in an object-oriented way. With a many-to-many relationship such as Students-Subjects, where each student gets a mark for a certain subject, assuming the following: I want to be able to display all the marks for a given student. I want to display all the marks from

What is a supertype method?

I have googled couple of times but still can’t understand the supertype method. Can anyone please explain what is this? Answer There is a notion of supertype and subtype in OOPS, In java this kind of relationship is implemented by inheritance i.e. using extends keyword: Any member (fields, methods) declared in super class is to be called supertype. Therefore in

Advertisement