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 sort a map in java?
Which is bigger float or double?
What is appletviewer?
What are the types of classes in java?
what is marker interface ? what is the necessity of it?
What are the advantages and disadvantages of reference counting in garbage collection?
What is the range of the short datatype?
what is the difference between static class and singleton class? can we create static class?
2 Answers L&T, Octazen, Vamsi Labs,
What are assertions in java?
What are the two categories of data types in the java programming language?
Is list ordered in java?
In which JDK version event-delegation model is introduced?