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 52915

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.

11 votes

Camp challenges in one program

Your menu could be replaced by a switch instead. Switches are more readable, faster, easier to maintain/expand and the idiomatic way of doing such things: int choice = Integer.valueOf(scan.nextLi …
Mast's user avatar
  • 13.5k
4 votes

Password Generator, generate password of desired length

Note: The 65 comes from the CHARACTER_SET length, which I have found out before. It's 65 at the moment. But what if you want to support more or less characters? A different character set? You'd h …
Mast's user avatar
  • 13.5k
5 votes

Finding the smallest cube for which exactly five permutations of its digits are cube

This review will be mostly about style. boolean[] checked = new boolean[999]; Arrays.fill(checked, false); for (int i = 1; i < 999; i++) { You're using 999 two times here, without stating w …
Mast's user avatar
  • 13.5k
4 votes

Interview practice: Integer to Roman

Java is verbose, but it doesn't have to be this verbose. There are also too many magic numbers. Code should be self-documenting and yours isn't. …
Mast's user avatar
  • 13.5k
7 votes
3 answers
22k views

Output two columns

Sample Input java 100 cpp 65 python 50 Sample Output ================================ java 100 cpp 065 python 050 ================================ printf is pretty …
Mast's user avatar
  • 13.5k
5 votes

MailQueue implementation with auto start - stop

If I read your code correctly (I'm no Java expert), you don't check if your threads get started. …
Mast's user avatar
  • 13.5k
13 votes

Writing a program to read a maximum of 99 elements in an iteration from a list

Let's take a look at naming and style. public class OptimizeReadingList { That sounds like a function, not like a class. // Add Elements to the Array for(int j =0;j<input_list_size …
Mast's user avatar
  • 13.5k
6 votes

Translating the Rubberduck - Übersetzen der Gummiente - Part 1: Modelling

Your naming seems inconsistent. public interface OverviewView { void register(OverviewPresenter p); void initialize(); void show(); void rebuildWith(List<Translation> translations); …
Mast's user avatar
  • 13.5k
6 votes

Converting long values in Java to unsigned strings

Since you're asking about readability, let's take a look at that. Your functions and variables could be named better. Especially parts like this: static final void digitsPlus(Digit sourceDigits, …
Mast's user avatar
  • 13.5k