Is there a way that after you store something, such a Rectangle, to an object variable, say, Object x, that you can then look at object x, and determine it is indeed a rectangle, allowing you to use Graphic methods such as draw on said object?
LevelSix 12 Junior Poster in Training
Recommended Answers
Jump to PostI think there is something called: "instance of". I don't remember by heart how to use so might want to search it, but I do know that it works almost like this:
Rectangle r = new Rectangle(); if ( r instance of Rectangle ) { }
But …
All 4 Replies
sayedjustetc 0 Newbie Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
ejosiah 4 Junior Poster
LevelSix 12 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.