please write java program of instanceOf keyword implementation
Answers were Sorted based on User's Feedback
Answer / 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 |
Can we change the scope of the overridden method in the subclass?
What is difference between word and integer?
What is Marker interface in java? and what is clone?
What is the difference between public, private, protected, and friend access?
Which is faster set or list in java?
How do you use equal in java?
Name few "optional" classes introduced with java 8 ?
Is 0 a prime number?
what are three ways in which a thread can enter the waiting state? : Java thread
What is the file type?
What is java algorithm?
What is volatile keyword in java