What is the significance of the keyword static in a method declaration?
User-Defined Methods
Original Khojo Papers practice question — not from a past board paper.
A pure method does not change the state of its object or of its arguments and returns the same result for the same input. An impure method changes the state of the object or of the arguments passed to it.
No citable source has been recorded for this record. Treat it as practice material, not as fact.
A method that only reads the fields and returns a value is pure; one that assigns to a field is impure.
From the same topic and chapter, at a similar level.
What is the significance of the keyword static in a method declaration?
User-Defined Methods
Write a Java method that takes an integer and returns true if it is a palindrome.
User-Defined Methods
Distinguish between a formal parameter and an actual parameter, and explain call by value.
User-Defined Methods
What is method overloading? State the conditions under which two methods are said to be overloaded.
User-Defined Methods
Explain the ternary operator in Java and rewrite "if (a > b) max = a; else max = b;" using it.
Operators and Expressions in Java
What is the output of: String s = "Examination"; System.out.println(s.length() + " " + s.substring(0, 4) + " " + s.toUpperCase().charAt(2));
String Handling