Java Quiz to Enhance Your Programming Skills

1 min


3
  1. 1 What will be the output of the following code:

    import java.util.ArrayList;

    import java.util.List;

    public class ListDemo {

    public static void main (String args[])
    {
    List list=new ArrayList();
    list.add(2);
    list.add(3);
    m(list);
    public static void m(List list) {
    System.out.println(list);
    }
    }

    }


    1. 3.0
    2. 3
    3. Runtime exception
    4. Compile time exception
    Correct!
    Wrong!
  2. 2 Which of the below is valid way to instantiate an array in java?

    1. int myArray [] [] = {1,2,3,4};
    2. int myArray [] = {1, 3, 5};
    3. int [] myArray = (5, 4, 3);
    4. int [] myArray = {“1”, “2”, “3”};
    Correct!
    Wrong!
  3. 3 Which of those doesn’t have an index based structure?

    1. List
    2. Map
    3. Set
    4. None of the above
    Correct!
    Wrong!
  4. 4 Which interface should be implemented for sorting on basis of many criteria’s?

    1. Comparator
    2. Comparable
    3. Serializable
    4. None of the above
    Correct!
    Wrong!
  5. 5 We can invoke any number of methods by one instance only

    1. True
    2. False
    Correct!
    Wrong!
  6. 6 What will be the output of the below program?

    1. Prints “c = 65”
    2. Compile Time Error
    3. Prints “c = A”
    4. Runtime Error
    Correct!
    Wrong!

Java Quiz to Enhance Your Programming Skills

Created on
  1. Quiz result
    You scored
    Correct!
    Share Your Result
  2. Quiz result

    You scored
    Correct!
    Share Your Result

Like it? Share with your friends!

3

What's Your Reaction?

hate hate
5
hate
confused confused
1
confused
fail fail
8
fail
fun fun
8
fun
geeky geeky
6
geeky
love love
4
love
lol lol
5
lol
omg omg
1
omg
win win
9
win

0 Comments

Your email address will not be published. Required fields are marked *

Choose A Format
Story
Formatted Text with Embeds and Visuals
Image
Photo or GIF
List
The Classic Internet Listicles
Gif
GIF format
Poll
Voting to make decisions or determine opinions
Personality quiz
Series of questions that intends to reveal something about the personality
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Countdown
The Classic Internet Countdowns
Open List
Submit your own item and vote up for the best submission
Ranked List
Upvote or downvote to decide the best list item
Meme
Upload your own images to make custom memes
Video
Youtube and Vimeo Embeds
Audio
Soundcloud or Mixcloud Embeds