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
Tag: oop
why the getter method goes null when i call in another class?
but in the set method on another class when i got the value is exist,, so i have 3 classes the first class is getter setter class , second is the class to fill the set and the last is class to get the method getter,, but it goes null value… Answer Class A Class B Basically by using new
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.
How do you write a toString() method for an int array for object oriented programming?
How do you write an toString() method for an int array? Say to return the string representation of a 52 card pack? Here is an example array as part of a class: This is being done in an object oriented manner. How would a toString() method be written in this case in order to return a string representation of the
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
How to make clear that a parameter of a method serves as a return value?
Is there a way to show that a parameter of a method serves as return value? If I want to return one value it is no problem: public Set addIntegerToSet(final int i) { Set<Integer&…
Should the Exception.Message property be shown directly to users? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 years ago. Improve this question That may sound like a silly question but I’d like to gather some input regarding this. I’m used to see 2
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
How to ensure thread safety of utility static method?
Is there any general way or rules exits by which we can ensure the thread safety of static methods specifically used in various Utility classes of any applications. Here I want to specifically point out the thread safety of Web Applications. It is well know that static methods with Immutable Objects as parameters are thread safe and Mutable Objects are