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 |
Why there are some null interface in java? What does it mean?
When is the arraystoreexception thrown?
What is the difference between yielding and sleeping in java programming?
Explain the difference between intermediate and terminal operations in java8?
When do we use synchronized methods in java?
What are operators and its types?
Does the order of public and static declaration matter in main method?
What is java virtual machine and how it is considered in context of java’s platform independent feature?
What does a void function return?
Which one of the following suits the description of a string better: derived or primitive?
What is the immediate parent class of the Applet class?
What is the access scope of a protected method?