please write java program of instanceOf keyword implementation
Answer Posted / dhanasekar
public class MainClass {
public static void main(String[] a) {
String s = null;
if (s instanceof java.lang.String) {
System.out.println("true");
} else {
System.out.println("false");
}
}
}
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Describe the term diamond problem.
What does the string method compareto () do?
What is charat java?
Is there any sort function in java?
When is an object subject to garbage collection?
What are encapsulation, inheritance and polymorphism?
Is arraylist zero based?
What is the purpose of garbage collection in java? When is it used?
what are synchronized methods and synchronized statements? : Java thread
What is the map interface in java programming?
Can we write a class without main method in java?
What checkbox method allows you to tell if a checkbox is checked?
Is arraylist ordered in java?
what do you understand by the term string with respect to java?
What is an immutable object? How do you create one in java?