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.
Which of the following algorithms is most commonly used in Operating Systems for deadlock prevention?
In C, which function is used to release dynamically allocated memory?
In C, what will be the output of the following code?
int a = 5;
printf("%d", a++);
Which Java keyword is used to inherit a class?
In C++, which feature allows hiding the internal details of a class?
- Which of the following is the primary benefit of Big Data analytics in decision-making?
Which of the following is used to declare a list in Python?
In Java, which method is used to start a thread?
Which Python keyword is used to handle exceptions?
In Python, which of the following is immutable?