-
instanceof
Does anyone know the answer to this?
Suppose r contains a reference to a new Rectangle(5, 10, 20, 30). Which of these conditions return true?
a) r instanceof Rectangle
b) r instanceof Shape
c) r instanceof Point
d) r instanceof Object
e) r instanceof ActionListener
f) r instanceof Serializable
-
you need to specify how your class hierarchy is
-
a) r instanceof Rectangle - true
b) r instanceof Shape - true
c) r instanceof Point - false
d) r instanceof Object - true
e) r instanceof ActionListener - false
f) r instanceof Serializable - true
eschew obfuscation
Similar Threads
-
By Lim Wing Hoe in forum Java
Replies: 7
Last Post: 11-17-2000, 02:12 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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|