• Post Reply Bookmark Topic Watch Topic
  • New Topic

Seeing java in action  RSS feed

 
Greenhorn
Posts: 14
Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you guys think of a website with resources where I can see simple java code in action? I mean like a program that calculates a coin flip chances, 50/50?

I know I can right click on games and some website apps and see code, but it's 10000 lines and not all of it makes sense.

Looking for a refresher set of code lines if that makes any sense.
I mean beyond the most basic "hello world" applications that just generate one printout line

Thanks
 
Ranch Hand
Posts: 789
C++ Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know of anything like that, but somebody might.

Write yourself the application you described. Read the milliseconds from the system clock and if the number is even print heads and if the number is odd print tails. Then instead of running it from Eclipse go to the debugger screen and execute the code one line at a time. Choose "step over" from the menu to execute a line at a time. That whole program would just be a few lines. Next revision you could display a picture of heads or tails instead of printing the words reusing almost all of the old code, and so on. Whatever you can imagine. Whatever is new and useful.
 
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you already know the basics then it's better to write your own apps step by step. That way you would understand how your own code works. More importantly why you wrote it that way.

You can always check out the Java tutorial here for the relevant topics you feel rusty on.
 
Sheriff
Posts: 4289
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about this site?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!