Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6227775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:16:44+00:00 2026-05-24T09:16:44+00:00

Code: System.out.println(Comparable.<Integer>isAssignableFrom(one.getClass())); Error: comp.java:16: cannot find symbol symbol : method <java.lang.Integer>isAssignableFrom(java.lang.Class<capture#128 of ? extends

  • 0

Code:

System.out.println(Comparable.<Integer>isAssignableFrom(one.getClass()));

Error:

comp.java:16: cannot find symbol
symbol  : method <java.lang.Integer>isAssignableFrom(java.lang.Class<capture#128
of ? extends java.lang.Integer>)
location: interface java.lang.Comparable
    System.out.println(Comparable.<Integer>isAssignableFrom(one.getClass()));

How can I determine whether some given type can be passed as an argument of type SomeInterface?

PS: Is there a Java reference manual/programmer’s handbook that would have given me the answer to this question in reasonable time (i.e. without requiring reading thousands of pages of irrelevant verbiage)? At the moment I find myself programming Java by trial-and-error, which really sucks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:16:45+00:00Added an answer on May 24, 2026 at 9:16 am

    Due to type erasure, it’s not possible to test if a particular object is an instance of a specific generic type (which it looks like is what you’re trying to do here). The closest you can get is to test if the object is an instance of the raw Foo type:

    System.out.println(one instanceof Comparable);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen some code such as: out.println(print something); I tried import java.lang.System; but it's
I am wondering about the the following piece of Java code: System.out.println. I am
final Integer[] arr={1,2,3}; arr[0]=3; System.out.println(Arrays.toString(arr)); I tried the above code to see whether a
A simple design question. Sample code: Integer int1 = new Integer(20); System.out.println(Integer.toBinaryString(int1)); Why JDK
In my client, I have this code: System.out.println(Java tz: + TimeZone.getDefault()); System.out.println(Joda tz: +
My Java source code: String result = B123.replaceAll(B*,e); System.out.println(result); The output is: ee1e2e3e .
This code: System.out.println(String.format(%f, Math.PI)); System.out.println(Math.PI); produces that result on my computer: 3,141593 3.141592653589793 Why
I use next code to print current time Calendar cal = Calendar.getInstance(); System.out.println(cal.getTime()); I
Consider this code: public <T> List<T> meth(List<?> type) { System.out.println(type); // 1 return new
Consider this code: int x = 17; int y = 013; System.out.println(x+y = +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.