Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
2 votes
0 answers
71 views

Classes for Config and logical operators

I have a spring cloud gateway application with this yml structure for request validation: ...
Q2Dev's user avatar
  • 21
1 vote
1 answer
482 views

Model animals using inheritance in Java

I was assigned the following problem: You've gone back in time to 500BC Athens and Socrates wants you to build him an app to help classify animals. Build the classes ...
apex2022's user avatar
  • 161
4 votes
2 answers
138 views

Human Jug and Glass

I am a beginner in Java. I have created this small project in Java with the inheritance concept. Here the Human will fill, pour and drink water. There are three classes: Glass, Jug and Human. Let me ...
Jency's user avatar
  • 143
5 votes
1 answer
132 views

Classes to encode and decode images

I'm a developing a image processor, which reads a Base64 (compressed) image and writes its subimage to targets on threads. (Constructors, exception handling, and ...
ylem's user avatar
  • 153
6 votes
4 answers
3k views

Better way to add fields to superclass in Java

I'm making my first steps in OOP and I'm currently doing some exercises. I've done a simple program with class structure like this (I'll provide only essential parts): Super class: ...
Vel's user avatar
  • 179
5 votes
1 answer
4k views

Custom ResponseModel for Spring Controller - ResponseEntity<?>

I created a custom responseModel to have a standard json responseModel for some of my different RestController. Superclass TransactionResponseModel: ...
Patrick's user avatar
  • 131
3 votes
3 answers
5k views

OOP modelling of a car agency

Exercise: A car dealer wants a computer system to manage the data of their vehicles and classify them by type. All cars have the following data Engine serial number Brand Year ...
I likeThatMeow's user avatar
9 votes
1 answer
3k views

OOP modeling of a boat rental system

I have some question about this exercise, did I model the problem correctly (the code works)?. If I did it correctly, Is there anything that can improve the code?. For example, how could I avoid the ...
I likeThatMeow's user avatar
4 votes
3 answers
118 views

Viewing the final state of an Object

As a beginner I was writing a code which asks the burger buyer what they want in their burger. I did this by creating a burger object and modify its attributes by the user using a switch case method. ...
Huzo's user avatar
  • 287
0 votes
2 answers
242 views

Very complicated Java HelloWorld app

This program attempts to shows the basic concepts of inheritance and polymorphism. In what ways could the code be modified to better demonstrate those concepts? The interface, abstract class and the ...
Jim Ferguson's user avatar
0 votes
4 answers
237 views

Multilingual command handler using inheritance

My problem is that you have a lot of ifconditions to be checked and inside that if condition you have multiple lines of code. I ...
Akila Hettiarachchi's user avatar
7 votes
2 answers
603 views

Java - Something similar to Abstract Factory?

I have many repositories stored in a map. User chooses some of them and then a downloading begins. Repository may be one of 4 types (see code below). ...
naXa stands with Ukraine's user avatar
2 votes
1 answer
1k views

Lockable linked list

The existing design of class DList and DListNode is taken. The main criteria is to do successive updates in \$O(1)\$ time. Part ...
overexchange's user avatar
  • 3,401
6 votes
1 answer
380 views

Code Golf challenge that plays Mafia

I am working on writing a Code Golf King of the Hill challenge, the details of which can be read here. You can read the full code here. Briefly, the game proceeds in cycles of night then day. There ...
Faraz Masroor's user avatar
11 votes
2 answers
5k views

Decomposing the animal kingdom

I have implemented a Mammal class hierarchy in Java. Is it an intelligent approach, with respect to decomposition, locality and procedural abstraction? ...
Rauf javid's user avatar

15 30 50 per page