04 - JAVA PROGRAMMING TUTORIAL - Creating Variables (Mac, Windows, Linux)

Loading...

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

Link to this comment:

Share to:

Uploader Comments (slushfilmz)

  • Dude, every time I do it JUST LIKE YOU, it says the following:

    Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - variable word might not have been initialized at test.main(test.java:7)

    Java Result: 1

    This is my code:

    class test

    { public static void main(String[] args) { String word: "Hey this is my first variable!"; System.out.println(word); }

    }

  • @TheFurion101

    Change the ':' after the word, into an equal sign. Then it will work.

  • }, How do you write this character? I can't find it on my keyboard?

  • @astroboomboy

    It is beside the 'P' character on the keyboard. Hold shift while clicking one of the characters beside 'P'.

  • I keep running the string and it responds like this:

    Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: system.out.print at test.main(test.java:6)

    Java Result: 1

    BUILD SUCCESSFUL (total time: 3 seconds)

    my code looks like:class test

    {  public static void main(String [] args) { String word = "got it!"; system.out.print(word); }

    }

    why won't it run?

  • @run42032

    You got to change the 'system.out.print' to 'System.out.print'...you didn't add the capital.

see all

All Comments (25)

Sign In or Sign Up now to post a comment!
  • -1.4 b and +1.4 b what a weird number set

  • String is an object. not a data type

  • how do you make singel quote..(before and after the T) on a macbook pro?

  • yep!

  • this guys so awesome

  • @astroboomboy noobishness

  • Thank you so much for this series!

  • Im just starting to get interested in Java Programming, I seen the first 3 & its helping me alot Thanks dude

  • Wtf is this shit, everytime I type in something it says its wrong like "class test" how the fuck can that be wrong?

  • @TheFurion101 Had the same problem.. Just kept editing in my codes and it worked..

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