• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Finished Java class  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I just finished my first class in java and I feel like I learned next to nothing.  Maybe the basics.  I want to continue learning it on my own now and want to create a program for work that is basically like this:
-A user logs in
-Fills out several fields
-Fields get saved

And this is where I'm not sure how to continue:
-These fields get saved into a database (sql?) that the fields can be sorted out in different ways.  I wouldn't mind learning sql along the way if that would be the most convenient.
-Email out the program through outlook

Also, I'd like to create a gui and several programs built into one that is just like the above.   Possibly a tabbed program where you have program 1 with different fields, program 2 with also other fields and program 3 with other fields. 

I'm looking if someone can point me in the right direction for any of the above that can help my learning journey along the way.

Thanks in advance.
 
Master Rancher
Posts: 3631
40
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Baby steps.

That description covers a lot of ground, so I would suggest taking it a bit at a time.

For example, you should be able to write the basics of this without a GUI or database, using the console for input (Scanner).

Try and keep the interface detached from any "business logic", that way when you do start with a GUI you will find it easier to swap out the old interface with the new.

After that you can add some persistence...possibly starting simply with a file on disk.
Again, try and keep the persistence logic detached (use interfaces), that way when you do add a database instead you should be able to just swap out that side of things.

Essentially, try not to do this all at once as you'll get your knickers in a twist.
 
Marshal
Posts: 60168
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell us what you have been taught and what you know. Also tell us how long your teaching went on for.
 
karol siwik
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Appreciate the advice guys.  Ok, baby steps.  My teachings went on for 8 weeks and covered arrays, for loops, if statements, file streaming and using other methods from different classes.

Thanks guys.
 
Campbell Ritchie
Marshal
Posts: 60168
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That covers a lot more ground than you think. Show us the neatest way to implement the following statement:-

If the grade is less than 40, print “fail,” otherwise print, “pass.”

Assume the grade variable has already been declared. That should give us a hint about how much you know. It will also show us whether you know any coding style.
 
karol siwik
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if (grade < 40) {
  System.out.print("fail");
}
else {
  System.out.print("pass");
}
 
Sheriff
Posts: 5130
138
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks good!  (Minor point: please UseCodeTags [that's a link])

Do you know how to use the Scanner class to get input from the keyboard?  (Technically, from the standard input.)  If not, do you know how to lookup the API documentation for Scanner?
 
Marshal
Posts: 6015
415
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
karol, no worries, doctors have examining instincts in their venous, anyway, you know why? Because they can now is weekend, please give some time to respond, Campbell might be busy.
 
Campbell Ritchie
Marshal
Posts: 60168
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was helping at the beer festival at S******n.

That is nicely formatted code, but there is a much shorter way to print those outputs.
When Liutauras asked about keyboard input, let's reduce that to a method which will return an int from input to System.in and which will never throw an input mismatch exception. Rob Spoor taught me how to do that a long time ago.
 
karol siwik
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Haha no worries there's no rush to get this done anytime soon anyway.  I just wanted to keep practicing Java and continue learning it outside my regular work/school.  I really appreciate the help. 
So far I was able to create one of those programs where I can take the users input and was going to output into a text file and I stopped there.  What I mean by programs is similar to "Sheets" in Excel. 
Sorry about the code tags!
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey I may be a couple months late to this, but if you're still looking for a place to expand your programming skills, than I'd recommend the Java Programming 10th Edition book.
If you can't find a physical copy than I'm very confident that there's a pdf version of it online.

For example, the Scanner that other people are talking about is a tool used for reading from the console and is talked about in chapter 2 of the Java Programming 10th Edition book.
You can learn about the code in the book and then at the end of the chapter there's a few exercises to help you test your knowledge as well.

I used the program NetBeans IDE when working through the book but you can probably use any java supported coding tool you want.

Hope this helps and good luck on your programming experience!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!