Results 1 to 3 of 3
Like Tree2Likes
  • 2 Post By Fubarable

Thread: 2 Simple Java Questions.. Thanks for your help

  1. #1
    jajajones is offline Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Default 2 Simple Java Questions.. Thanks for your help

    A float can hold a wider range of values than an int, but not as many digits.
    Answer

    A. True
    B. False

    --------------------------------------------
    What is wrong with the following code?
    final int MAX_VALUE = 100;
    //...
    MAX_VALUE = 500000;
    Answer


    A. final is not allowed in the declaration of MAX_VALUE

    B. 500000 is not an int value

    C. MAX_VALUE cannot be changed to anything greater than 100

    D. MAX_VALUE cannot be assigned a value after it is initialized

    ---------------------------------------------------

    What is the output from the following Java program?
    class X
    {
    public static void main(String[] args)
    {
    int x = 3, y = 4;
    System.out.println("x / y = " + x / y);
    }
    }
    Answer


    A. x / y = 0

    B. x / y = 0.75

    C. The program won't compile because there is a syntax error in the variable declarations.

    D. The program won't compile because there is a syntax error in the output line.

  2. #2
    jajajones is offline Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Default Re: 2 Simple Java Questions.. Thanks for your help

    sorry... 3 questions! i've looked everywhere for these and couldn't find anything

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: 2 Simple Java Questions.. Thanks for your help

    Please don't just dump your questions here. At least tell us what you think the answers should be and why. Else this is nothing more than a homework/work dump and is not appreciated.
    Bestsanchez and DarrylBurke like this.

Similar Threads

  1. Simple questions from a very new java user
    By Cu Annan in forum AWT / Swing
    Replies: 11
    Last Post: 07-05-2011, 12:00 AM
  2. Simple Questions- Stop JPanel Blinking
    By MrFish in forum AWT / Swing
    Replies: 7
    Last Post: 04-10-2011, 06:23 PM
  3. Simple Java IO Questions
    By TheWolfe in forum New To Java
    Replies: 3
    Last Post: 11-30-2010, 01:40 AM
  4. Simple array questions
    By jigglywiggly in forum New To Java
    Replies: 6
    Last Post: 02-15-2009, 05:57 AM
  5. 2 simple java questions
    By jimJohnson in forum New To Java
    Replies: 2
    Last Post: 02-02-2008, 09:35 AM

Posting Permissions

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