Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

Knute Snortum

Sheriff
+ Follow
since Apr 20, 2013
Knute likes ...
Chrome Eclipse IDE Java Postgres Database VI Editor
Forum Moderator
Knute Snortum currently moderates these forums:
After 25 years of programming, Knute has retired to be a professional musician. Knute first learned BASIC and Cobol on a CPM Timeshare system circa 1985. He spent way too long coding in one flavor of Business Basic or another. Going back to college, he learned C and a whole new world opened up to him. Knute likes Perl and Java, for completely opposite reasons. Knute is a complex person.
Portland, Oregon
Cows and Likes
Cows
Total received
138
In last 30 days
2
Total given
207
Likes
Total received
891
Received in last 30 days
6
Total given
267
Given in last 30 days
6
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Knute Snortum

Don't feel alone.  This entire forum is dedicated to people like you learning and struggling with Java.  You should try googling first, but many times that is not enough.

If you're interested in really getting the most out of this forum, look through the wiki about how to ask questions.
14 hours ago
I'm the outlier here.  For getting input from the keyboard, the only function I use from Scanner is nextLine().  This is for two reason.  One, I want to be able to detect when the user only presses <Enter>.  I use this behavior to enter default values.

    What is the meaning of the Universe? (default = 42):

The other is that if you use nextInt() or any of the other nextXxx() functions you can run into this problem:

    What is your age? 6e

Here the user has slipped and accidentally typed 6e instead of 64.  I don't want the program to accept 6 and leave e in the buffer.  I want the program to ask for the age again.

Campbell and I do agree on one thing: you really need to write a utility class to wrap Scanner (or maybe BufferedInput?).  Add prompting and validation and you have a handy class.  I call mine Inputer and it's freely available on my GitHub repo.
14 hours ago
Karla Carr,

Please don't start a new thread about the same subject.  Thank you.
17 hours ago
Karla Carr,
I have merged your topic into this topic. I hope that helps.
17 hours ago
I merged your stuff with the following thread. I hope that is okay by you.
17 hours ago
I'm going to assume that your question is, How do I retrieve an enum values from a String value?  If that is correct, then try this:
18 hours ago
This is still not helpful, I'm afraid.

* Code doesn't compile
* Code not formatted correctly
* Many unnecessary lines of code
* Not clear what the code's intent is.
19 hours ago

Joshua Braud wrote: I wasn't aware of the multi-statement in the  main() method practice. Could you please explain? Thanks


Campbell already gave you the link, but here it is again: MainIsAPain
5 days ago
I took the String that you created and modified it back to an SQL statement (below).  I may be wrong, but I think you go off the rails at the AND that I marked with a comment.  It seems that it could be controlled by the second WHERE clause, but the parentheses do not match.

Carey Brown wrote:You don't have a main() method.


Does there need to be a main() method in this class?
1 week ago
Thanks for the clarification.  Off-by-one errors are hard.
1 week ago

paul wheaton wrote:I see two question marks, but I am struggling to understand the question(s).


Harry and I have been communicating via PMs and I encouraged him to post here.  I believe he's asking it if there other ways -- especially notifications -- that a user can be alerted when someone posts on a thread that the user is following.

Harry, the answer is that currently email is the only option, but someone might be willing to make this modification in the future.
1 week ago
Here are some comments on your code not related to the subject of the thread:

* The Java convention is to start a variable with a lowercase letter.
* final int Limit = Integer.parseInt("1000"); can be simplified to final int Limit = 1000;
* If you follow the convention, this code
would be written
* It's a good idea to get out of the habit of posting all your code in the main() method.  A standard template for this would look like this:
1 week ago
It could be a dead end -- in the sense that there's no through traffic.  Or it could just be a private road.  The sign is ambiguous.
2 weeks ago