Variables and Data Types – Multiple Choice Questions (MCQs)
-
-
14. Which keyword is used to declare a variable as a constant in Java?
-
15. What is the scope of a local variable in Java?
-
16. What is the scope of an instance variable in Java?
-
17. What is the scope of a static variable in Java?
-
18. Which of the following is a valid variable declaration in Java?
-
19. Which of the following is NOT a valid variable name in Java?
-
20. What is type casting in Java?
-
21. What is implicit type casting (widening) in Java?
-
22. What is explicit type casting (narrowing) in Java?
-
23. Which operator is used for type casting in Java?
-
24. What will be the result of `(int) 3.14`?