Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java instanceof Operator

class Main {
  public static void main(String[] args) {

    String str = "Programiz";
    boolean result;

    // checks if str is an instance of
    // the String class
    result = str instanceof String;
    System.out.println("Is str an object of String? " + result);
  }
}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #Java #instanceof #Operator
ADD COMMENT
Topic
Name
9+9 =