Results 1 to 3 of 3
  1. #1
    sachin218 is offline Member
    Join Date
    Nov 2012
    Posts
    1
    Rep Power
    0

    Default What is the Right Answer :

    Question : Which of the following tasks cannot be performed using an enhanced for loop?
    1) Multiplying all the values in an array together
    2)Displaying all even element values in an array
    3)Comparing the elements in an array to a specific value
    4)Incrementing the value stored in each element of the array


    According to my knowledge I am thinking right answer for this is (1).But seem's like I am wrong.
    Can some one please let me know the correct Answer for this :

    Thanks in Advance....!

  2. #2
    SJF
    SJF is offline Senior Member
    Join Date
    Oct 2012
    Posts
    108
    Rep Power
    0

    Default Re: What is the Right Answer :

    Java Code:
      for(String s: StringVector){
            //Do Something cool
      }
    You tell us.

  3. #3
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: What is the Right Answer :

    I am thinking right answer for this is (1).But seem's like I am wrong.
    "Seems"? It either is possible, or it isn't. How would you multiply the elements of an array using an enhanced for loop? Ie, what code?

    Then use the same strategy on 2->4: write code and you will discover that one of the four tasks is intractable.

Similar Threads

  1. Compare true Answer /Player answer
    By Eilime in forum New To Java
    Replies: 1
    Last Post: 04-24-2011, 09:51 PM
  2. Could anyway answer me this?
    By Jojomofoman in forum New To Java
    Replies: 14
    Last Post: 12-17-2010, 12:14 AM
  3. Please answer me quickly
    By sweet girl in forum New To Java
    Replies: 20
    Last Post: 12-10-2010, 11:17 PM
  4. Replies: 12
    Last Post: 07-27-2010, 10:40 AM
  5. Help me answer a few questions
    By namlunxxx in forum XML
    Replies: 3
    Last Post: 06-16-2010, 06:26 PM

Posting Permissions

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