• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

answer to question no8 of sample questions is wrong

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel that answer to question no8 of sample questions(from sun) provided by is wrong.
According to them it is b)
but I feel that a) is the correct answer because extend word has been used instead of extends
import java.awt.*;

public class Test extend Frame {
public Test() {
add( new Label("Hello") );
add( new TextField("Hello") );
add( new Button("Hello") );
pack();
show();
}
public static void main(String args[]) {
new Test();
}
}
What is the result?
a)The code will not complile.
b)A window will appear containing only a Button.
c)An IllegaArgumentException is thrown at line 6.
d)A window will appear but will not contain the Label, TextField, or Button.
e)A window will appear containing a Label at the top, a TextField below the Label, and a Button below the TextField.
f)A window will appear containing a Label on the left, a TextField to the right of the Label, and a Button to the right of the TextField .


[This message has been edited by Rahul Agarwal (edited October 05, 2000).]
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This could be printing mistake. If it there in real exam than you are right.
Dharmesh.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree Rahul. I found the same error last night, but tonight the question has the correct "extends". I thought the use of the
deprecated method show() was also odd.
There are still 2 possible typos in question 1.
Typos in the published sample questions are a cause for concern if they reflect a similar lack of care with the real questions.
 
You showed up just in time for the waffles! And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic