Question
What is the purpose of the 'static' keyword in
Java?Solution
A static variable/method belongs to the class, not to any specific object. Static variables are shared across all instances. Static methods can be called without creating an object (e.g., Math.sqrt()). A static variable like interestRate in a BankAccount class would be shared by all account objects. 'final' makes a variable constant. 'final class' prevents subclassing. 'protected' restricts access.
Cinnabar is an ore of which metal?
Which gas is the chief component of Bio-gas?
Which of the following is used in alcoholic drinks?
Whose experiments supports Abiotic synthesis?
Which of the following pollutants is the major contributor to photochemical smog?
Which of the following fatty acids does NOT form soap?
Which of the following is the richest source of phosphorus?
"Schist" is the example of which type of rock?
Which element is known as the 'King of Chemicals.
_____________ has the maximum attraction force between the molecules.