
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
What is the C# equivalent to Java's isInstance()?
The java.lang.Class.isInstance() determines if the specified Object is assignment-compatible with the object represented by this Class
Java’s isInstance() method’s equivalent in C# is IsAssignableFrom().
Another simplest way for isInstance() equivalent is −
bool res = (ob is DemoClass);
You can also work with Type.IsInstanceOfType for the same result −
ob.GetType().IsInstanceOfType(otherOb)
- Related Articles
- What is the Java equivalent to MySQL's smallint?
- What's the Kotlin equivalent of Java's String[]?
- C# equivalent to Java's Thread.setDaemon?
- What is the PHP equivalent of MySQL's UNHEX()?
- C# Equivalent to Java's Double Brace Initialization?
- Kotlin equivalent of Java's equalsIgnoreCase
- What is the equivalent of C# namespace in Java?
- What is the C# equivalent for the Java System.exit(0)?
- instanceof operator vs isInstance method in java
- What is the equivalent of Java static methods in Kotlin?
- What is the equivalent of Java static final fields in Kotlin?
- What is the Linux Equivalent to DOS Pause?
- What is the equivalent of Matlab's surf(x,y,z,c) in Matplotlib?
- What is the Certainty Equivalent Method?
- What is the equivalent of Java long in the context of MySQL variables?

Advertisements