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 lambda in java?
Nested classes VS Inner classes?
Name the package that most of the AWT events that supports event-delegation model are defined?
What is classpath?
Can we use String with switch case?
Can we declare array without size in java?
What is tree node in java?
what is difference between length and length()?
What are different types of states exist for a thread?
Infinite loop using while ?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
Which is better singleton or static class?