Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 41406

Java (not to be confused with JavaScript) is a class-based, object-oriented, strongly typed, reflective language and run-time environment (JRE). Java programs are compiled to bytecode and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.

4 votes
Accepted

Find minimum window size which includes the subset of characters

The first big issue that crosses my mind: Naming. In particular, commenting variables is always a sign that you did a poor job on giving them good names: int j = 0; // the trailing position of the sl …
Ingo Bürk's user avatar
  • 1,008
1 vote

Modeling a Triangle, with a utility method to classify it

Just a quick detail I haven't seen in the other answers: if (!isSaneArguments(a, b, c)) { throw new IllegalArgumentException("All sides of a Triangle must be > 0"); } First off, I don't really …
Ingo Bürk's user avatar
  • 1,008
4 votes

Graph Implementation in Java 8

These are mostly going to be general comments. private Map<T, Node<T>> adjacencyList; This field can (and should) be made final. This applies to fields in your other classes as well. I also don' …
Ingo Bürk's user avatar
  • 1,008
5 votes

Field class used by my trading card game

Something I like to do to counter this is using Optionals which before Java 8 would be using Google's Guava, but as of Java 8 it is a built-in functionality (though I still like Guava's implementation …
Ingo Bürk's user avatar
  • 1,008
3 votes
Accepted

Trading Card Game's Hand and HandView implementation and unit tests

public interface Viewable<T extends Viewable<T, V>, V extends View<T>> { public void addViewCallback(final V view); public void removeViewCallback(final V view); } Drop the public keywords …
Ingo Bürk's user avatar
  • 1,008
3 votes

Create better Unit test

public void create_Created(){ This violates Java coding standards. In Java, the convention is camelCase, not snake_case. On top of that, the name create_Created is utterly meaningless. …
Ingo Bürk's user avatar
  • 1,008
1 vote
Accepted

ListView with a search filter

It is a Java standard to use camelCase, which means a method is named appendList, not AppendList. …
Ingo Bürk's user avatar
  • 1,008
7 votes

New MD5 algorithm

The common Java standard is camelCase, not snake_case. So variables should be named someVariable, not some_variable. Your method is (way, way) too long. …
Ingo Bürk's user avatar
  • 1,008
2 votes

Error-handling / Self-Validating mechanism

I'd actually prefer a List (Java 8): public class ErrorInfo { private final List<String> messages = new ArrayList<>(); public ErrorInfo addMessage( String message ) { messages.add( message …
Ingo Bürk's user avatar
  • 1,008
15 votes

Password validation in Java

Something that I don't think has been mentioned: Don't return strings like that. The logic should be separate from the representation. So do something like public static enum PasswordValidationResul …
Ingo Bürk's user avatar
  • 1,008
5 votes
Accepted

Executing a file through a swing button

I know this is, for some reason, the preferred way to set braces in the Linux kernel code, but this is Java, not C. You are using hard-coded file paths. Absolute no-go. …
Ingo Bürk's user avatar
  • 1,008
10 votes

Bank card validation module

A few more things, next to the answer by 200_sucess: Your class maintains state and as such it should not be all static methods, but work with proper instances. However, you also use state in a rath …
Ingo Bürk's user avatar
  • 1,008
3 votes
Accepted

Fetch details from server

Nothing android-specific, only regarding Java. Fetch_Details breaks Java conventions. Use camelCase! 14 fields in a class is too much and is just begging to be split into several classes. … If someone can't infer that from the code, they have never seen a line of Java in their life. …
Ingo Bürk's user avatar
  • 1,008