- 
                    
- 
                    
- 
                    
- 
                    In Java, all class objects need not be dynamically allocatedA) TrueB) False 
- 
                    
- 
                    A paramter is a variable defined by a method that receives a value when the method is called.A) TrueB) FalseExplanation: A argument is a variable defined by a method that receives a value when the method is called. 
- 
                    
- 
                    
- 
                    The Code in java is contained within MethodsA) TrueB) False 
- 
                    A class is declared by use of the ________ keyword.A) ObjectB) ClassC) Instance D) None of the above 
- 
                    When we create a class, we are creating a new data typeA) TrueB) False 
- 
                    Through _________ , you can control what parts of a program can access the members of a classA) EncapsulationB) ClassC) InheritenceD) Polymorphism 
- 
                    Java allows objects to initialize themselves when they are created using _________A) ArgumentsB) ClassesC) ConstructorsD) Parameters 
- 
                    The new operator dynamically allocates ________ for an object and returns a reference to it.A) ClassesB) VariablesC) Memory D) None of the Above 
- 
                    
- 
                    
- 
                    
- 
                    What is the output of the following? // A simple example of recursion.class Factorial { // this is a recursive method int fact(int n) { int result; if(n==1) return 1; result = fact(n-1) * n; return result; }} class Recursion { public static void main(String args[]) { Factorial f = new Factorial(); System.out.println("Factorial of 3 is " + f.fact(3)); }}A) Factorial of 3 is 3B) Factorial of 3 is 6C) Factorial of 3 is 9D) None of the above 
- 
                    
- 
                    
Java Classes Questions

 
  
  
  
		
Ans