Skip to main content

All Questions

Tagged with
-1 votes
0 answers
20 views

Need to extract a method to use in equals implementation with Hibernate DTO's

I am updating a Java project and had to add an equals() implementation 3 java DTO files (call them Child1, Child2 and Child3) which all extend the DTO Parent class. IntelliJ generated the following ...
ponder275's user avatar
  • 923
-1 votes
0 answers
32 views

Does a socket instantiated in a parent class belong to its child class?

I'm making a messaging service in java where I'm using sockets and object input/output streams. I wanted to make this as object oriented as I can (to learn OOP) so for the client side I'm making an ...
Cyberdrum's user avatar
1 vote
1 answer
42 views

Inherit override-equivalent as different methods

Several methods from interface, super class or new method are override equivalent. I need to make different realization for each. Example: public interface A { int f(); } public interface B { ...
Andrew's user avatar
  • 15
3 votes
1 answer
49 views

Multiple constructors annotated with Lombok @Builder cause a problem?

This is my first question, so please feel free to correct anything that I missed writing this question:) I am having trouble with using the @Bulider with my DTO objects. I have an abstract class "...
Doh Kun Lee sanity's user avatar
-1 votes
0 answers
32 views

Polymorphism in Java Spring [closed]

I develop an application in Java Spring. I have an abstract superclass called AbstractPuzzle and I have its children called Wordle and Riddle(I have JOINED type of inheritance). I get an ...
rxvxl's user avatar
  • 1
2 votes
0 answers
66 views

Base class not recoginsed while using wild card generic

Why is the below not working? A b1 = new B(); Function<? super B, ? extends A> function = x -> new B(); A apply = function.apply(b1); It gives an error "Required type capture of ? ...
Sijo Kurien's user avatar
-2 votes
2 answers
67 views

How do I create a member that can accept 2 very similar interfaces?

I currently have two classes that do exactly the same but have differences of a single member. interface interfaceA { VariationA getVariation(); } interface interfaceB { VariationB ...
תומר ש's user avatar
-1 votes
1 answer
28 views

Why does the custom ArrayAdapter constructor in this example not match the superclass constructor exactly?

I was following a tutorial on creating a custom ArrayAdapter for a ListView in Android. Here is the custom adapter class from the tutorial: public class NumbersViewAdapter extends ArrayAdapter<...
minh's user avatar
  • 27
-1 votes
1 answer
41 views

Java Protected Field Access Issue in Subclass

What is the difference between public, protected, package-private and private in Java? The question's answer cannot answer my question. It's not a duplicate question. I totally know the diagram of ...
maplemaple's user avatar
  • 1,435
0 votes
2 answers
48 views

How to upgrade Java class to extension class?

I have a simple problem. I have a large class: public class Base { public Field1Data field1; public Field2Data field2; public Field3Data field3; // many more fields later... public ...
tuskiomi's user avatar
  • 183
0 votes
0 answers
16 views

Efficient design solution for handling dynamic marking schemes with multiple levels and subjects

We're developing a grading system for a school with multiple levels (e.g., elementary, middle school, high school) and various subjects within each level (n subjects < 200). The challenge is that: ...
shithanshu mishra's user avatar
0 votes
2 answers
60 views

Initializing properties of derived classes in Kotlin

I want to know why exactly my code returns "nullnullnull" instead of expected answer and why does it work correctly when method is used. Consider the following code: open class Base( ...
entendrious's user avatar
-1 votes
3 answers
125 views

Are all abstract classes parent classes? [closed]

I started learning Java few months ago. I am wondering if all abstract classes are parent classes. An abstract method in an abstract class won’t have a body. So the abstract method it must be ...
Roshin Maharjan's user avatar
1 vote
2 answers
65 views

Is it possible to override a Point2D object from a superclass to a Point2D.Float?

I have defined a class called Entity with a Point2D object in it called pos. The class is a superclass and it's not specified if pos should be a Point2D.Float or a Point2D.Double, that's left for the ...
Gabriel Vinagre Coppens's user avatar
0 votes
1 answer
52 views

Why JPA is adding fields of subclass when dealing with superclass? How to prevent that?

I want to use a SQL function to get length of a saved blob. I use jpa, an enity and a repository for that. My implementation looks more or less like this: public interface UploadRepository extends ...
aGentleUser's user avatar

15 30 50 per page
1
2 3 4 5
580