File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Mock Exam Errata and the fly likes ///incompatible types/// Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "///incompatible types///" Watch "///incompatible types///" New topic
Author

///incompatible types///

chao-long liao
Ranch Hand

Joined: Jul 29, 2001
Posts: 78
www.levteck.com/MockExams/TestSarga.htm
Given a TextArea using a proportional pitch font and constructed like this:
TextField t = new TextArea("12345", 5, 5);
Which statement is true?
A. The displayed width shows exactly five characters on each line unless otherwise constrained
B. The displayed height is five lines unless otherwise constrained.
C. The maximum number of characters in a line will be five.
D. The user will be able to edit the character string.
ans:B,D
why?
and there is ont thing,the code will cause compile error.
Any help are appreciated.
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

Originally posted by chao-long liao:
www.levteck.com/MockExams/TestSarga.htm
Given a TextArea using a proportional pitch font and constructed like this:
TextField t = new TextArea("12345", 5, 5);
and there is ont thing,the code will cause compile error.

Correct, this won't compile because TextField and TextArea don't have an "is-a" relationship...
If it was: TextComponent tc =new TextArea("12345", 5, 5 ); -- it would work fine and b and d would be correct.
Moving this to MockExam Errata. Please continue te discussion there.


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ///incompatible types///