Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
3 answers
198 views

Java exceptions that show the message when converted to String

I’m working with custom exceptions in Java for stack operations. However, I’m unsure if the exception handling is being handled properly, especially in terms of how exceptions are thrown and caught. ...
Somesh Diwan's user avatar
2 votes
1 answer
171 views

Beginner Java Tic-Tac-Toe

I had a Tic Tac Toe assignment for class and the program seems to work fine but I feel like the exception/input handling could be done in a much better way. Is this a good way to approach the ...
Drosos-kal's user avatar
1 vote
3 answers
112 views

Extensible error code infrastructure

I was answering a question, Java Exception Error Enumerations Anti-pattern, on Software Engineering Stack Exchange and found myself writing up a fair bit of code. It could use a code review so I'm ...
candied_orange's user avatar
3 votes
1 answer
963 views

Generic Scanner(System.in) Parsing

Often end up using a Scanner to grab some simple input and often when dealing with Number input it can result in a lot of little ...
Tim Hunter's user avatar
4 votes
2 answers
254 views

Sanity check a simple RPG character

I'm writing an assistant for the tabletop RPG Pathfinder in Java. I intend to use the MVVM pattern using JavaFX, possibly through mvvmFX. Before I go into the V-VM phase, I have built a first ...
Anab's user avatar
  • 385
4 votes
2 answers
259 views

Reader for graph-file with ugly return and questionable use of streams

I wrote a class that contains a static method that reads in files from NetworkRepository and converts them into a list of integer-arrays, each representing an edge. The file format from ...
Moritz Groß's user avatar
11 votes
2 answers
360 views

Self-inflicted killing utility

If you need to kill the same process that you're in (for testing purposes or whatever) this code will do it. A definitive, quick, unmerciful dead of the current Java program/app. Not a System.exit(0) ...
Oscar Besga Panel's user avatar
0 votes
1 answer
155 views

One try with multiple catch blocks vs nested try

I am creating program which will parse .csv file and I am using FileReader and Scanner classes from java API. ...
Genjik's user avatar
  • 103
2 votes
1 answer
1k views

Employee database

To keep in practice with good techniques of java programming, I've decided to write a database. All it does it stores employees, allows users that are logged in to get/set employees, and has a login ...
Ben A's user avatar
  • 10.7k
4 votes
2 answers
2k views

Compiling and throwing simple dynamic exceptions at runtime for JVM

I've been using my Dynamic Exception with C# for quite some time already and it saved me a lot of time. This means, I don't have to create a new exception ...
t3chb0t's user avatar
  • 44.6k
2 votes
1 answer
84 views

Exception handling with null check in java

...
Hyeonseo Yang's user avatar
0 votes
1 answer
100 views

Using a wrapper on a primitive as a generic for an interface used for Java lambda

I apologize for that title, lol. I have a Java method that I'm writing where I want to be able to pass in an array of Objects and two interfaces that will be used for lambda expressions that specify ...
Devsman's user avatar
  • 113
4 votes
2 answers
409 views

Automatic exception wrapper in java

There's a lot of place in my code where I need to do something like this ...
Winter's user avatar
  • 151
3 votes
1 answer
269 views

Custom exceptions for validating movie information

I wrote my first application about custom exceptions and catching them. Here is the GitHub link. I Have 3 types of custom exceptions: TimeException (validate time: hours, minutes) MovieException (...
llooll's user avatar
  • 33
1 vote
1 answer
205 views

Is it a valid use case of using java.util.MissingResourceException?

I have a factory method that returns an Object based on a argument passed to it : ...
Innocuous's user avatar

15 30 50 per page