Results 1 to 6 of 6

Thread: Hey, Ummm Help?

  1. #1
    BlueZap is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Default Hey, Ummm Help?

    Hey, everybody. I have just started seriously using java, prior to my new interest in the language it's self I just modded minecraft. Anyways, this forum is quite confusing, and I was wondering if anyone could tell me where to ask the following:

    I was wondering if I could declare an integer value that has no default value (like a variable). Anybody know how?

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default Re: Hey, Ummm Help?

    Java Code:
    int someInt;
    This has no value and relies on being initialized.

  3. #3
    BlueZap is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Default Re: Hey, Ummm Help?

    Quote Originally Posted by sunde887 View Post
    Java Code:
    int someInt;
    This has no value and relies on being initialized.
    Why thank you :) this is perfect. It simplifies stuff a lot!

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default Re: Hey, Ummm Help?

    declare an integer value that has no default value
    That makes no sense. With this statement:
    x = 123;
    123 is a integer value and x is a variable. the value of 123 is 123

  5. #5
    DK Bello is offline Member
    Join Date
    Dec 2011
    Location
    UAE
    Posts
    29
    Rep Power
    0

    Default Re: Hey, Ummm Help?

    So what happens if i say,
    x = y;

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default Re: Hey, Ummm Help?

    If you don't understand how an assignment statement works you need to go back to your textbook or tutorial and read up.
    x = y; // set x to the value that is in y

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •