Jesse and Freya- java lesson 1: Java hello world

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
804 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 21, 2008

Please comment, rate, subscribe, enjoy.

Sorry about the fan noise.

Jedit Site (You should get this if you don't use linux)
http://www.jedit.org/

Link to a downloadable version of the code:
http://filer.case.edu/jof1/HelloWorld.java

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (ErebusWolf)

  • Hay Jesse, does this look right to you?

    {public static void main(String[] args) {PrimeNumber(321);} public static double PrimeNumber(double number) {double sqr = (double) Math.sqrt ( number ); System.out.println("Root = " + sqr); for (double i=2; i<sqr; i++) {double n = sqr%i; System.out.println(n); if (n==0) { System.out.println("This is not a prime number"); } if (n!=0) {System.out.println("This is a prime number");} } return sqr; }}

  • no problem about formatting . I am just glad that you didn't intentionally do it that way. Short answer is no. Your program does not work. There is no whole number that it finds to be not prime. enter 25 as a number and see if it's prime. First EVERY number should be an int. there is no reason for them to be doubles. the square root value should be rounded up (add one to it) . and your for loop should be <= . also you should return a boolean (true/false) not return the same value put in. Thanks!

see all

All Comments (20)

Sign In or Sign Up now to post a comment!
  • Zelda triangle in the back :)

  • First off, sorry for replying to the wrong video. Don't know why that happened. Also, thanks for the advice, i was wondering why I wasn't getting the correct square root, just add one, so simple. Ill give it another shot. Thanks Jesse.

  • sorry it looks like that, i was only allowed 500 chars

  • if you would rather not do it that way. I suggest deleting that line from the file. The System.... line and then try javac again after saving. See what happens they try putting it back in manually.

  • ok well, I wanted to keep this on the youtube message board so other people could benefit but I think we are beyond that. Send me a private message with an AIM MSN Skype or gtalk account you want to talk with me on.

  • it says javac 1.6.0_07

  • it says javac 1.6.0_07

  • in a command prompt type "javac -version"

    Then at the top of the output text find the version number. Comment that version number here. Also, try retyping the HelloWorld program. It might be an issue of mac formatting vs windows formatting.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more