Skip to main content

Questions tagged [java]

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.

85 votes
5 answers
9k views

I always get marked down for my comments and I just wanted to see if these comments are acceptable or what I should include/where I should include them. ...
Eric Irwin's user avatar
62 votes
3 answers
4k views

Calculating probabilities in Minesweeper might sound like an easy task, but I've seen so many probability calculators that's either incorrect, horribly slow, or with ugly code (or all of them) so I ...
Simon Forsberg's user avatar
37 votes
2 answers
8k views

Weekend Challenge #2 - Poker Hand Evaluation Very early I decided to support the usage of wild jokers, even though I knew that this was going to lead to trouble more work. I also wanted to support ...
Simon Forsberg's user avatar
98 votes
9 answers
33k views

Magic numbers are bad... I totally agree. But there's one magic number I find hard to fix: '100' is a magic number. Consider this code: ...
janos's user avatar
  • 113k
23 votes
6 answers
14k views

I have coded up an implementation of Conway's Game of Life and I have a performance bottleneck in it which I wish to be optimized. The main logic is in the Universe ...
Adam Arold's user avatar
20 votes
3 answers
4k views

Description This is my code for the Weekend Challenge Reboot - Tic Tac Toe Ultimate. The game can be played here: http://www.zomis.net/ttt (along with some other variations that are also use the ...
Simon Forsberg's user avatar
12 votes
4 answers
5k views

I created a singleton class for managing sound effects on Android. This class will only be instanced and loaded once at the beginning, and each activity will use the loaded songs. I don't know either ...
FR073N's user avatar
  • 231
12 votes
1 answer
217 views

Following some great advice here from Simon, I realized that I had over-engineered things, and that the Task builder methods were a horrible Java8 abstraxction. In Simon's words: "From a usability ...
rolfl's user avatar
  • 98.2k
8 votes
4 answers
17k views

The program assignment: A drunkard in a grid of streets randomly picks one of four directions and stumbles to the next intersection, then again randomly picks one of four directions, and so on. ...
user avatar
12 votes
3 answers
6k views

I've just done Problem 12 of Project Euler: What is the value of the first triangle number to have over five hundred divisors? The \$N\$'th triangle number is the sum of all natural numbers ...
Connor Cartwright's user avatar
5 votes
3 answers
632 views

Please help me to make more readable and simple code like this. What if I had 20 components? Is it right to organize code like this? ...
Valery's user avatar
  • 381
2 votes
1 answer
2k views

This post elaborates on NBA*: Very efficient bidirectional heuristic search algorithm in Java. I have made the following changes: Added an explicit type for representing digraph paths: ...
coderodde's user avatar
  • 33.1k
57 votes
8 answers
36k views

I'm looking for code review, best practices and optimizations. ...
JavaDeveloper's user avatar
47 votes
2 answers
1k views

To download the tool and for usage instructions, see the follow up to this question Description I have realized that there's a whole bunch of code I want to have reviewed, but copying file by file, ...
Simon Forsberg's user avatar
35 votes
3 answers
1k views

In an earlier question, I showed my code for calculating the mine probability for each and every field in a Minesweeper board. But it doesn't stop there. In that very same Minesweeper Analyze project, ...
Simon Forsberg's user avatar

15 30 50 per page
1
2 3 4 5
72