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 |
What is finally in exception handling?
Who developed java?
Is 0 an irrational number?
What is a protected class in java?
can any one send me the example program of immutable class?
How do you make a thread in java?
Explain the difference between abstract classes and interfaces in java?
Can we use a switch statement with strings?
Can we extend singleton class in java?
What is the purpose of finalization in java programming?
why do we use interface in java?
What is the difference between Byte stream and Charecter Stream?