Site icon DataFlair

Quiz on Java Method

quiz on java method

Get Job-ready: Java Course with 45+ Real-time Projects! - Learn Java

Buckle up, Java warriors! It’s time to unleash your inner coder and put your method mastery to the test. This comprehensive quiz is designed to be a challenging yet rewarding journey through the fundamentals of Java methods.

Whether you’re a seasoned veteran with years of experience or a fresh-faced programmer just starting your Java odyssey, this quiz is the perfect tool to sharpen your skills and solidify your understanding.

Dive deep into the world of methods, tackle a variety of questions, and identify areas where your knowledge can truly shine. Not only will you gain valuable insights into your strengths and weaknesses, but you’ll also have the opportunity to reinforce core concepts and emerge a more confident Java developer.

So, are you ready to answer the call? Take the quiz, embrace the challenge, and watch your method mastery level up! Let’s test your knowledge.

Time limit: 0

Quiz Summary

0 of 15 Questions completed

Questions:

Information

You have already completed the quiz before. Hence you can not start it again.

Quiz is loading…

You must sign in or sign up to start the quiz.

You must first complete the following:

Results

Quiz complete. Results are being recorded.

Results

0 of 15 Questions answered correctly

Your time:

Time has elapsed

You have reached 0 of 0 point(s), (0)

Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)

Categories

  1. Not categorized 0%
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  1. Current
  2. Review / Skip
  3. Answered
  4. Correct
  5. Incorrect
  1. Question 1 of 15
    1. Question

    class MethodSample {

    void addition(int a , int b) {

    System.out.println( a + b );

    }

    void subtraction (int a , int b) {

    System.out.println(a-b);

    }

    void multiplication(int a , int b){

    System.out.println(a*b);

    }

    public static void main ( String args [ ] ) 

    {

    addition(3,4);

    subtraction(5,2);

    }

    }

    Correct
    Incorrect
  2. Question 2 of 15
    2. Question

    class Methods {

    void inputMethod ( ) {

    Scanner sc = new Scanner(System.in);

    int a = sc.nextInt();

    }

    void display ( ) {

    System.out.println(“The Given Number is “ + a );

    }

    public static void main ( String args [ ] )

    {

    *****;

    *****;

    }

    }

    Correct
    Incorrect
  3. Question 3 of 15
    3. Question

    class First { 

    void method ( ) {

    System.out.println(“DataFlair”);

    }

    };

    public class Second {

    public static void main ( String args [ ] )

    {

    Second object = new object();

    object.method():

    }

    }

    Correct
    Incorrect
  4. Question 4 of 15
    4. Question

    class  MethodsSample {

    void text ( String a , int b ) {

    System.out.println (  a + b );

    }

    public static void main ( String args [ ] )

    {

    text ( 1 , “ DataFlair “ );

    }

    }

    Correct
    Incorrect
  5. Question 5 of 15
    5. Question

    class Example {

    void sampleMethod ( String text) {

    System.out.println(text);

    }

    public static void main ( String args [ ] ) {

    sampleMethod(“DataFlair”);

    sampleMethod(“DataFlair”);

    sampleMethod(“DataFlair”);

    }

    }

    Correct
    Incorrect
  6. Question 6 of 15
    6. Question

    class Sample {

    int addition ( float x , float y ) {

    return x + y ;

    }

    };

    class Main {

    public static void main ( String args [ ] ) 

    {

    System.out.println(addition ( 32.8 , 7.2 ));

    }

    }

    Correct
    Incorrect
  7. Question 7 of 15
    7. Question

    class Methods {

    int multiplication ( int a , int b , int c ) {

    c = a * b ;

    }

    public static void main ( String args [ ] )

    {

        System.out.println(multiplication(3,5));

        }

    }

    Correct
    Incorrect
  8. Question 8 of 15
    8. Question

    Which of these is the way for method Overloading ?

    Correct
    Incorrect
  9. Question 9 of 15
    9. Question

    class MethodOverloading {

    void addition( String a , String b ) {

    System.out.println(a + b );

    }

    static int addition ( int a , int b ) {

    return a + b;

    }

    };

    class MainFunction {

    public static void main ( String args [ ] )

    {

    addition(“Data”, “Flair”);

    system.out.println(addition(1,2));

    }

    }

    Correct
    Incorrect
  10. Question 10 of 15
    10. Question

    class MethodOverloading {

    static int  addition ( int a , int b ) {

    return a + b ;

    }

    void addition ( int a , int b , int c ) {

    return a + b + c ;

    }

    public static void main ( String args [ ] ) 

    {

    system.out.println(addition(1,2,3);

    }

    };

    Correct
    Incorrect
  11. Question 11 of 15
    11. Question

    class Exception { 

    void _first( ) {

    System.out.println(“Method is executed”);

    }

    public static void main ( String args [ ] )

    {

    _first();

    }

    }

    Correct
    Incorrect
  12. Question 12 of 15
    12. Question

     class Sample {

    void display ( ) {

    int a;

    system.out.println(a);

    }

    public static void main ( String args [ ] ) 

    {

    display();

    }

    }

    Correct
    Incorrect
  13. Question 13 of 15
    13. Question

    Which of the following in Java does not return a value inside a method ?

    Correct
    Incorrect
  14. Question 14 of 15
    14. Question

    class MethodSample {

    void radius ( int d ) {

    system.out.println(d/2);

    }

    int area ( float r ) {

    return 3.14*r*r;

    }

    public static void main ( String args [ ] )

    {

    System.out.println(radius(10) + area(radius(10));

    }

    }

    Correct
    Incorrect
  15. Question 15 of 15
    15. Question

    Which of the following is not a true statement about methods in Java programming ?

    Correct
    Incorrect

Summary:

Embark on a journey of self-discovery through a series of meticulously crafted questions designed to delve deep into your understanding of method creation, utilization, and problem-solving techniques. By actively engaging with these challenges, you’ll not only solidify your grasp of existing Java knowledge but also uncover areas where your skills can truly flourish.

Consider this quiz a stepping stone on your path to Java mastery – a chance to identify knowledge gaps, build a robust foundation, and ultimately achieve programming proficiency. So, are you ready to put your skills to the test? Dive in and prepare to be surprised by your potential!!

Exit mobile version