-
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks