Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

Question: Which class is the wait() method defined in? I get incompatible return type for my thread getState( ) method!
Answer: It sounds like your application was built for a Java software development kit before Java 1.5. The Java API Thread class method getState() was introduced in version 1.5. Your thread method has the same name but different return type. The compiler assumes your application code is attempting to override the API method with a different return type, which is not allowed, hence the compilation error.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook