If you know that thing
contains a Subclass
, you can do:
((Subclass) thing).specialMethod()
More Related Contents:
- Replace a character specific number of times in String Java
- How do I check if a file exists in Java?
- How to determine day of week by passing specific date?
- Is there a way to simulate the C++ ‘friend’ concept in Java?
- What is the difference between Set and List?
- java.lang.ClassNotFoundException in spite of using CLASSPATH environment variable
- Why won’t this generic java code compile?
- How to calculate elapsed time from now with Joda-Time?
- Java creating .jar file
- Encryption of video files?
- How do I move a file from one location to another in Java?
- How to import spring-config.xml of one project into spring-config.xml of another project?
- java – path to trustStore – set property doesn’t work?
- Class object of generic class (java)
- Selenium WebDriver: clicking on elements within an SVG using XPath
- Android room persistent: AppDatabase_Impl does not exist
- Is it bad practice to make a setter return “this”?
- JSF backing bean structure (best practices)
- EL expressions won’t executed in Tomcat 5.5, but working in tomcat 6.0.20
- What is the sorting algorithm for Java [closed]
- Loading a map using Properties class
- Clone method for Java arrays
- Java : Does wait() release lock from synchronized block
- Force Java timezone as GMT/UTC
- Spring .properties file: get element as an Array
- Could not resolve placeholder in string value
- Implement tags bar in JavaFX
- Error executing testng.xml through CLI : Could not find or load main class org.testng.TestNG
- How to get Date in the same format as String [duplicate]
- Java Swing Timer