• Post Reply Bookmark Topic Watch Topic
  • New Topic

Just picked up on java again  RSS feed

 
Trey Martin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And this is about all I can do. I took about a half year hiatus from Java, and want to get back in to it. I was programming to see what all I still knew, and this is it. So, how do you think I should continue programming? Completely restart? Or fill in the blanks to what I don't know? Lol, I'm sort of confused on how to restart learning. Feel free to critic this code if need be. ;)

 
Anuj Sharma R
Greenhorn
Posts: 28
1
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get a good book, do a java refresher of things you already know, do lots of practical coding and you should be good.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trey Martin wrote:And this is about all I can do. I took about a half year hiatus from Java, and want to get back in to it. I was programming to see what all I still knew, and this is it.

Which suggests to me that you've either forgotten a lot, or you didn't get very far to begin with (and that's not meant as a criticism; simply an observation), because what you've written, although nominally a class, is actually a procedure.

Sorry if I sound harsh, but you did ask for opinions.

So, how do you think I should continue programming? Completely restart?

That would be my advice. Get a decent book (Head First Java is supposed to be pretty good) and start from scratch. You may find, as you go through it, that things start to come back to you, and that you can make quick work of the early exercises; but do do them.

Feel free to critic this code if need be. ;)

OK:
1. It looks like "stream of consciousness" code to me - ie, as if you simply started writing code to solve a problem, rather than sitting down with a pencil and paper, and designing your solution.
2. Big main() methods are almost always bad.
3. Any method more than 20 lines long can usually be broken up into smaller ones.

HIH

Winston
 
Trey Martin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems I should restart. Not sure where the line between beginner and intermediate is, but I do remember touching on inheritance and extending methods and other things like that. I'll take a look at Head Start Java, thank!

Edit: Winston, that's exactly what I did. I just added in things as they came back to me. I was going to add a GUI but I don't remember getting to that at all.
 
Campbell Ritchie
Marshal
Posts: 56540
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope it's not too late to welcome you to the Ranch

If you are starting GUIs from scratch, you should probably go for JavaFX; here is a tutorial. There are doubtless other tutorials.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trey Martin wrote:Edit: Winston, that's exactly what I did. I just added in things as they came back to me. I was going to add a GUI but I don't remember getting to that at all.

And for a "restart" exercise that's probably fine; just don't make a habit of it. And, like I said, sorry if I sounded a bit harsh.

And a second tip for you (admittedly, a personal one): Steer clear of GUIs for a while yet.

They're verbose, finicky, and "focused"; and have a lot of "process" you need to know about to prevent things like "screen flicker", which have nothing to do with what they're actually there for; which is to display the contents of your program and accept input.

And in the early stages you can usually do exactly the same thing (albeit more clunkily) with System.out.println() and a Scanner.

My 2¢

Winston

[Edit] Oops. Totally missed it until Campbell's post. Welcome to javaRanch!
 
Trey Martin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for all the welcomes everyone! Winston, no hard feelings. ;) I am familiar with scanners, I used one at the very top of my code. Found a Head First book for Java on Amazon, I'll have it in 3 days. Can't wait to get started again!
 
Campbell Ritchie
Marshal
Posts: 56540
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope you didn't pay full price for the book. There are so many second‑hand copies avaiable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!