What should be the output of this code?

Discussion in 'HTML & Website Design' started by computerzworld, May 11, 2007.

  1. #1
    Hi. I have one code which I am not able to run on my pc because of older version of windows. Please tell me what should be the output of this code.

    Public Void doGet(HttpServletRequest req, HttpServletResponse res)
    {
    print Writerout=res.getWriter();
    res.BufferSize(1024);
    out.println("Hello");
    res.reset();
    out.println("How");
    res.flushBuffer();
    out.println("Are you?");
    res.reset();
    }


    This question was asked in exam and I want the output of this. Please tell me if anyone knows. Thanks in advance.
     
    computerzworld, May 11, 2007 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello

    How

    Are you?
     
    T0PS3O, May 11, 2007 IP
  3. computerzworld

    computerzworld Active Member

    Messages:
    214
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    means there is no effect of reset() and flushbuffer()?
     
    computerzworld, May 11, 2007 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think Are you? is on top of the previous two (i.e. screen wiped). But I know little about desktop programming.
     
    T0PS3O, May 11, 2007 IP
  5. computerzworld

    computerzworld Active Member

    Messages:
    214
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    ok means the output will look like this,
    Are you?

    Hello

    How


    Is it?
     
    computerzworld, May 11, 2007 IP
  6. Arnold9000

    Arnold9000 Peon

    Messages:
    241
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I think these are things to confuse you, since you said it was a test. I agree with TOPS 30. Except I think it's actually this

    Hello
    How
    Are You?

    No double spaces between them
     
    Arnold9000, May 11, 2007 IP