Question
1.   Predict the output of the code public
class Animal { Â Â public static void main(String args[]) Â Â Â Â Â Â Â Â Â Â Â {Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â public int localVar = 5; Â Â Â Â Â Â Â Â Â Â Â } Â Â Â Â Â Â Â Â }Solution
- Illegal Access Modifier in Method Scope :
- The keyword public is not allowed within the body of a method to declare a variable. Variables declared inside methods are considered local variables, and local variables cannot have access modifiers (public, private, protected).
- This results in a compilation error.
A sum of money lent out at simple interest amounts to Rs.620 after 2 years and to Rs.1220 after a further period of 4 years. The sum is:
Neil buys a Camera priced at 32000. He pays 8000 at once and the rest after 15 months on which he is charges a simple Interest at the rate of 18% per an...
A man invested Rs. 'B' at simple interest of 18% and Rs. 'B + 4000' at simple interest of 14% p.a., for 4 years each. If the interest earned from both i...
An amount becomes seven times of itself in 48 years at simple interest. Find the value of (5R − 15), where R is the rate of interest per annum.
- Sneha invested Rs. 2700 at 15% p.a. for 2 years and Gopal invested Rs. 3600 for 1.5 years at 18% p.a. Find how much more interest Sneha received than Gopal...
Rohit invested a sum on compound interest at 'R%' per annum (compounded annually), which amounts to ₹8,000 and ₹11,520 in 2 years and 4 years respec...
What is the difference between the simple interest earned on an investment of Rs. 16,200 for 5.5 years at an annual interest rate of 8%, and the total a...
A sum of money C is Rs. 8000 more than B, B and C are invested at 10% p.a and 12.5% p.a, S.I for two years and the difference between the interest obtai...
- The amount on a certain principal at simple interest is Rs. 6,750 after 2 years and Rs. 9,000 after 5 years. What was the initial sum?
Maya had Rs. 12000 with her. She invested 30% of the sum at 8% p.a. and the rest at 18% p.a., both at simple interest for 5 years each. Find the total i...