please write java program of instanceOf keyword implementation

Answers were Sorted based on User's Feedback



please write java program of instanceOf keyword implementation..

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

please write java program of instanceOf keyword implementation..

Answer / karunakar

false

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can we change the scope of the overridden method in the subclass?

0 Answers  


What is difference between word and integer?

0 Answers  


What is Marker interface in java? and what is clone?

16 Answers   Persistent, Wipro,


What is the difference between public, private, protected, and friend access?

0 Answers   Amazon,


Which is faster set or list in java?

0 Answers  


How do you use equal in java?

0 Answers  


Name few "optional" classes introduced with java 8 ?

0 Answers  


Is 0 a prime number?

0 Answers  


what are three ways in which a thread can enter the waiting state? : Java thread

0 Answers  


What is the file type?

0 Answers  


What is java algorithm?

0 Answers  


What is volatile keyword in java

0 Answers  


Categories