CoderMantra

Menu
  • Home
  • Quiz
  • How-To
  • Blog

java exam

0 votes, 0 avg
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Java Questions

1 / 15

1. What is the default value of String variable?

2 / 15

2. What will be the output of the following Java program?

        class recursion 

{

int func (int n)

{

int result;

if (n == 1)

return 1;

result = func (n - 1);

return result;

}

}

class Output

{

public static void main(String args[])

{

recursion obj = new recursion() ;

System.out.print(obj.func(5));

}

}


                            

3 / 15

3. Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?

4 / 15

4. What is the process of defining a method in terms of itself, that is a method that calls itself?

5 / 15

5. What is the function of javap command?

6 / 15

6. What should be the execution order, if a class has a method, static block, instance block, and constructor, as shown below?

    public class First_C {  
       public void myMethod()   
        {          System.out.println("Method");  
        }  
        {       System.out.println(" Instance Block");  
        }    
        public void First_C()  
        {       System.out.println("Constructor ");  
        }  
        static {           System.out.println("static block");  
        }       public static void main(String[] args) {       First_C c = new First_C();  
        c.First_C();  
        c.myMethod();  
      }  
    }   

7 / 15

7. How to convert Date object to String?

8 / 15

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

    class abc

    {

        public static void main(String args[])

        {

            if(args.length>0)

            System.out.println(args.length);

        }

    }

9 / 15

9. What is true about final class?

10 / 15

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

        class A 

        {

            public int i;

            protected int j;

        }    

        class B extends A 

        {

            int j;

            void display() 

            {

                super.j = 3;

                System.out.println(i + " " + j);

            }

        }    

        class Output 

        {

            public static void main(String args[])

            {

                B obj = new B();

                obj.i=1;

                obj.j=2;   

                obj.display();     

            }

       }

11 / 15

11. Which data type value is returned by all transcendental math functions?

12 / 15

12. Which of the following is true about public access modifier?

13 / 15

13. Which of these is correct way of calling a constructor having no parameters, of superclass A by subclass B?

14 / 15

14. Which of the following are not java modifiers?

15 / 15

15. What is not the use of “this” keyword in Java?

Your score is

The average score is 27%

LinkedIn Facebook Twitter VKontakte
0%

Category

  • C Programming
  • Core Java
  • How To
  • Python Tutorial
  • Questions
  • Quiz
  • Tkinter Tutorial
  • What Is

Archives

  • March 2023
  • February 2023
  • May 2022
  • November 2021
  • May 2021
  • March 2021
  • November 2020
  • October 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • September 2019
  • August 2019
  • May 2019
  • March 2019
  • February 2019
  • January 2019
About CoderMantra

Coder Mantra is a unique e-learning website, offers a tutorial of different popular programming languages with examples. The code on this popular tutorial website is tested and executed.

Latest Posts
Adobe-Xd Questions March 28, 2023
C-Plus-Plus Questions March 21, 2023
Python Questions March 20, 2023
C Questions March 18, 2023
Contact Us

info@codermantra.com

admin@codermantra.com

© 2020 Coder Mantra . All Rights Reserved
About | Privacy Policy | Terms | Contact