My Report

Java Programming Practice Test 2


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What is the process of defining two or more methods within same class that have same name but different parameters declaration?

2. Which of these is used as a default for a member of a class if no access specifier is used for it?

3. Which of this statement is incorrect?

4. Which of these methods must be made static?

5. Which of the following is a method having same name as that of its class?

6. How many copies of static and class variables are created when 10 objects are created of a class?

7. Where is a new object allocated memory?

8. What will be the output of the following Java code?

    class test 
    {
        int a;
        int b;
        void meth(int i , int j) 
        {
            i *= 2;
            j /= 2;
        }          
    }    
    class Output 
    {
        public static void main(String args[])
        {
            test obj = new test();
	    int a = 10;
            int b = 20;             
            obj.meth(a , b);
            System.out.println(a + " " + b);        
        } 
    }

9. Which of the following statements are incorrect?

10. Which of these can be overloaded?


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.