Search Results
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 |
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.
3
votes
Accepted
Convert length of time to appropriate unit
Here's one approach, using TreeMap. It looks up your number of milliseconds in a pre-populated map, finds the appropriate entry and does the division.
Just create one of these objects, and call the …
5
votes
Java function to read a CSV file
There's a constructor for Vector that takes any Collection as its argument. So you could write
String[] values = line.split(",");
csvData.add( new Vector<String>( Arrays.asList( values )));
inst …
1
vote
Finding "lucky numbers"
Have a try at turning this approach into Java code. Post a comment on this answer if you get stuck, and I'll try to give you some more guidance. …
4
votes
Generic Linked List Implementation in Java
My answer only deals with the "testing" part of your question, not the review of the classes themselves.
If I can start with a question - are you expecting LLNode to be used by other classes? Or is …
2
votes
Building a Breakout game from scratch
Split changeDirection in the Ball class into two methods, and simplify the mathematics in each of them. Something like
public void bounceVertical(){
direction = 540 - direction;
}
public void b …
3
votes
Accepted
General Java Style Suggestions - Classification Problem from CodeSprint 2012
Just off the top of my head:
In main - what should happen if args.length == 1 ? Currently, you'll get an exception.
Your field names are a bit odd - xTraining and yTraining in particular. Instead …