Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

You must login to add post.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

mcqoptions.com

mcqoptions.com Logo mcqoptions.com Logo

mcqoptions.com Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/Rario
  • Recent Questions
  • Most Answered
  • Answers
  • No Answers
  • Most Visited
  • Most Voted
  • Random
  1. Asked: 3 years agoIn: Java

    Do we have get(Object o) method in HashSet.

    (a) True

    (b) False

    The question was posed to me by my school teacher while I was bunking the class.

    Query is from Data Structures-Set in portion java.util – The Collections Framework of Java

    f736f
    Added an answer about 3 years ago

    Correct choice is (b) FalseTo explain: get(Object o) method is useful when we want to compare objects based on the comparison of values. HashSet does not provide any way to compare objects. It just guarantees unique objects stored in the collection.

    Correct choice is (b) False

    To explain: get(Object o) method is useful when we want to compare objects based on the comparison of values. HashSet does not provide any way to compare objects. It just guarantees unique objects stored in the collection.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Asked: 3 years agoIn: Java

    String in Java is a?

    (a) class

    (b) object

    (c) variable

    (d) character array

    b5328
    Added an answer about 3 years ago

    Correct answer is (a) classThe explanation: None.

    Correct answer is (a) class

    The explanation: None.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  3. Asked: 3 years agoIn: Java

    Which of the below is true about java class structure?

    (a) The class name should start with lowercase

    (b) The class should have thousands of lines of code

    (c) The class should only contain those attribute and functionality  which it should; hence keeping it short

    (d) The class attributes and methods should be public

    4e229
    Added an answer about 3 years ago

    Right option is (c) The class should only contain those attribute and functionality  which it should; hence keeping it shortFor explanation I would say: Class name should always start with upper case and contain those attribute and functionality which it should (Single Responsibility Principle); henRead more

    Right option is (c) The class should only contain those attribute and functionality  which it should; hence keeping it short

    For explanation I would say: Class name should always start with upper case and contain those attribute and functionality which it should (Single Responsibility Principle); hence keeping it short. The attributes should be usually private with get and set methods.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  4. Asked: 3 years agoIn: Java

    Which of these access specifiers must be used for main() method?

    (a) private

    (b) public

    (c) protected

    (d) none of the mentioned

    a82a2
    Added an answer about 3 years ago

    The correct choice is (b) publicEasiest explanation: main() method must be specified public as it called by Java run time system, outside of the program. If no access specifier is used then by default member is public within its own package & cannot be accessed by Java run time system.

    The correct choice is (b) public

    Easiest explanation: main() method must be specified public as it called by Java run time system, outside of the program. If no access specifier is used then by default member is public within its own package & cannot be accessed by Java run time system.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  5. Asked: 3 years agoIn: Java

    What happens if IP Address of host cannot be determined?

    (a) The system exit with no message

    (b) UnknownHostException is thrown

    (c) IOException is thrown

    (d) Temporary IP Address is assigned

    8a479
    Added an answer about 3 years ago

    Right choice is (b) UnknownHostException is thrownThe explanation: UnknownHostException is thrown when IP Address of host cannot be determined. It is an extension of IOException.

    Right choice is (b) UnknownHostException is thrown

    The explanation: UnknownHostException is thrown when IP Address of host cannot be determined. It is an extension of IOException.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  6. Asked: 3 years agoIn: Java

    PriorityQueue is thread safe.

    (a) True

    (b) False

    The question was asked during an interview.

    My question is from Data Structures-Queue in portion java.util – The Collections Framework of Java

    c4548
    Added an answer about 3 years ago

    Correct choice is (a) TrueThe best explanation: PriorityQueue is not synchronized. BlockingPriorityQueue is the thread safe implementation.

    Correct choice is (a) True

    The best explanation: PriorityQueue is not synchronized. BlockingPriorityQueue is the thread safe implementation.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  7. Asked: 3 years agoIn: Java

    What is the difference between length() and size() of ArrayList?

    (a) length() and size() return the same value

    (b) length() is not defined in ArrayList

    (c) size() is not defined in ArrayList

    (d) length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the list

    6b37b
    Added an answer about 3 years ago

    Correct answer is (d) length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the listExplanation: length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the list which is always less than or equal to capaciRead more

    Correct answer is (d) length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the list

    Explanation: length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the list which is always less than or equal to capacity.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  8. Asked: 3 years agoIn: Java

    What happens if ServerSocket is not able to listen on the specified port?

    (a) The system exits gracefully with appropriate message

    (b) The system will wait till port is free

    (c) IOException is thrown when opening the socket

    (d) PortOccupiedException is thrown

    a7134
    Added an answer about 3 years ago

    The correct answer is (c) IOException is thrown when opening the socketThe best I can explain: public ServerSocket() creates an unbound server socket. It throws IOException if specified port is busy when opening the socket.

    The correct answer is (c) IOException is thrown when opening the socket

    The best I can explain: public ServerSocket() creates an unbound server socket. It throws IOException if specified port is busy when opening the socket.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  9. Asked: 3 years agoIn: Java

    Which of these is a method of ListIterator used to  obtain index of previous element?

    (a) previous()

    (b) previousIndex()

    (c) back()

    (d) goBack()

    8116d
    Added an answer about 3 years ago

    The correct choice is (b) previousIndex()For explanation I would say: previousIndex() returns index of previous element. if there is no previous element then -1 is returned.

    The correct choice is (b) previousIndex()

    For explanation I would say: previousIndex() returns index of previous element. if there is no previous element then -1 is returned.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  10. Asked: 3 years agoIn: Java

    What does Collections.emptySet() return?

    (a) Immutable Set

    (b) Mutable Set

    (c) The type of Set depends on the parameter passed to the emptySet() method

    (d) Null object

    77f78
    Added an answer about 3 years ago

    Correct option is (a) Immutable SetTo explain I would say: Immutable Set is useful in multithreaded environment. One does not need to declare generic type collection. It is inferred by the context of method call.

    Correct option is (a) Immutable Set

    To explain I would say: Immutable Set is useful in multithreaded environment. One does not need to declare generic type collection. It is inferred by the context of method call.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
Load More Answers

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 393k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Aditi Dugal

    How to approach applying for a job at a company ...

    • 7 Answers
  • Raghavan Prasad Hayer

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Ankita Dinesh Biswas

    What is a programmer’s life like?

    • 5 Answers
  • 47e0c
    47e0c added an answer Correct Answer - Increasing the yield of animals and improving… November 12, 2022 at 9:56 am
  • b6699
    b6699 added an answer Sender\'s addressDateReceivers name and addressSubjectContentYours faithfullyName November 12, 2022 at 9:56 am
  • 10eb8
    10eb8 added an answer Any uncertinity in measurment is known as errorDifference in true… November 12, 2022 at 9:56 am

Top Members

Trending Tags

Class 11 Parabola Polity Polynomials Probability Projectile Protists Quadrilaterals Rario Reasoning Sampling Social Solutions Spectroscopy Switchgear Thermodynamic Tourism Transients Upsc Wbjee

Explore

  • Home
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Tags
  • Badges
  • Users

Footer

mcqoptions.com

About

MCQOptions.com

Here are the top interview questions, example answers, tips for giving the best response.

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Follow

© 2022 MCQOptions. All Rights Reserved