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

  • SEARCH
  • Home
  • 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 6747787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:29:09+00:00 2026-05-26T12:29:09+00:00

In Java, Class has an isAssignableFrom method defined as follows: public boolean isAssignableFrom(Class<?> cls)

  • 0

In Java, Class has an isAssignableFrom method defined as follows:

public boolean isAssignableFrom(Class<?> cls)

Determines if the class or interface represented by this Class object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified Class parameter. It returns true if so; otherwise it returns false. If this Class object represents a primitive type, this method returns true if the specified Class parameter is exactly this Class object; otherwise it returns false.

Specifically, this method tests whether the type represented by the specified Class parameter can be converted to the type represented by this Class object via an identity conversion or via a widening reference conversion. See The Java Language Specification, sections 5.1.1 and 5.1.4 , for details.

Parameters:

cls – the Class object to be checked

Returns:

the boolean value indicating whether objects of the type cls can be assigned to objects of this class

Class implements the Type interface. Is there an equivalent isAssignableFrom method that works on Types instead of just Classes? For example, is there a method that determines if a variable of type List<String> (which would be represented via an instance of ParameterizedType) can be assigned to a variable of type List<? extends Object>?

  • 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-26T12:29:10+00:00Added an answer on May 26, 2026 at 12:29 pm

    Have a look at javaRuntype — I’ve found it useful. It can produce representations of types from instances of java.lang.reflect.Type, and test assignability between them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Java class library has a class named DateTime. DateTime has this method: int
The JDBC java.sql.Statement class has a cancel() method. This can be called in another
A class which has a method declared as this: public class A{ public <T>
why java Object class has two methods hashcode() and equals()? One of them looks
I have a simple Java class that has some methods: public class Utils {
I have an application which resides in ROOT. This application has a java class(in
I am currently writing a java-class that wraps an SQLite database. This class has
Suppose I have a Java class that has 100K worth of method code containing
Java's java.lang.Class class has a getDeclaredFields method which will return all the fields in
The Java Collections class has the following method: static <T> List<T> nCopies(int n, T

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.