hai ranchers can any one can explain this question
45.What will be the result of compiling and running the given program?
Select one correct answer.
1. public class Q45
2. {
4. static
5. {
6. System.out.print("Java".startsWith(""));
7. }
8. static void processorB()
9. {
10. System.out.println(" is a boolean Operator.");
11. }
12. static Q45 processorA()
13. {
14. Q45 q=null;
15. if (("java").startsWith("null"))
16. return q;
17. else
18. return null;
19. }
20. public static void main(
String[] args)
21. {
22. processorA().processorB();
23. }
24. }
a Compile time error at line number 22 as you can't call processorB() like this.
b NullPointerException at line number 22 as processorA() will return null.
c Program will compile correctly and print false is a boolean operator when executed.
d Program will compile correctly and print true is a boolean operator when executed.
here the ans is d
by velan vel