DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Oct 2005

    Can someone explain why this happens?

    sample quiz question
    suppose that the following variable declarations have been made:
    int i = 0, int k = 0; String s = "@"; Give the exact output produced by the following code fragments:
    System.out.print(i==3); // I know this won't work
    System.out.println("Ans: "+(j++)+(++j)+(j++)+(++J); // I don't understand why it gives 0224 and not 1234
    for (; k<3; k++) {
    s = s+s;
    System.out.println(s); // I need to know why it returns 15 @ signs and not seven
    Thanks for the help
    Last edited by Mcody2; 11-01-2005 at 11:34 PM.

Similar Threads

  1. DB2 Visual Explain
    By jim pias in forum Database
    Replies: 0
    Last Post: 03-11-2003, 05:26 PM
  2. Can someone explain what is happening with this code...
    By Robert Tedesco in forum VB Classic
    Replies: 14
    Last Post: 05-05-2002, 06:00 AM
  3. Explain Plan does not provide output
    By shafiq in forum Database
    Replies: 3
    Last Post: 03-31-2002, 12:22 AM
  4. Can some one explain Recordset Page!
    By Johan in forum ASP.NET
    Replies: 0
    Last Post: 03-03-2002, 07:20 AM
  5. Explain >>> in details?
    By ken in forum Java
    Replies: 2
    Last Post: 02-06-2001, 03:21 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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.