Core Java Quiz

Description: Core Java Quiz
Number of Questions: 10
Created by:
Tags: java
Attempted 0/10 Correct 0 Score 0
  1. 1.java

  2. 2.javaw

  3. 3.javapath

  4. 4.javadoc

Correct Option: C
  1. 1.add(Object x)

  2. 2.remove(Object x)

  3. 3.contains(Object x)

  4. 4.insert(int i,Object x)

  5. 5.set(int I,Object x)

Correct Option: D

Providing access to the object only through its member functions,while keeping the details private is called_____

  1. 1.information hiding

  2. 2.encapsulation

  3. 3.Inheritance

  4. 4.modularity

Correct Option: B

To solve this question, the user needs to be familiar with the concepts of object-oriented programming and the principles of encapsulation and information hiding.

Now, let's go through each option and explain why it is right or wrong:

A. 1. information hiding: This option is correct. Information hiding is the practice of encapsulating the internal details of an object and providing access to it only through its member functions. This helps to hide the complexity and implementation details of an object, allowing for better maintainability and preventing unauthorized access to sensitive information.

B. 2. encapsulation: This option is correct. Encapsulation is the practice of bundling data and methods together within a class and providing controlled access to them. It allows for the implementation details of an object to be hidden and accessed only through the defined interface, promoting modularity and code reusability.

C. 3. Inheritance: This option is incorrect. Inheritance is a concept in object-oriented programming where a class derives properties and behaviors from another class. It is not directly related to the practice of providing access to an object only through its member functions and keeping the details private.

D. 4. modularity: This option is incorrect. Modularity refers to the practice of dividing a program into smaller, independent modules that can be developed, tested, and maintained separately. While encapsulation and information hiding contribute to modularity, modularity does not specifically refer to the practice of providing access to an object only through its member functions and keeping the details private.

The Answer is: B. 2. encapsulation

  1. 1.Empty set

  2. 2.one pair a==true,b==false

  3. 3.two pairs in which a==true

  4. 4.two paires in which a!=b

  5. 5.All 4possible combination

Correct Option: C

A "has a" relationship between classes represents ___ and "is a" represents__

  1. 1.static,nonstatic class

  2. 2.Inheritance,Composition

  3. 3.Composition,Inheritance

  4. 4.Overriding,Overloading

Correct Option: C

What is the default layout manager for a panel?

  1. 1.BorderLayout

  2. 2.Ther is no layout

  3. 3.FlowLayout

  4. 4.GridLayout

Correct Option: A
  1. 1.program ignores exceptn

  2. 2.program halts immediately

  3. 3.Program will not compile

  4. 4.None of the above

Correct Option: B

Which is not a characteristics of Java programming language?

  1. 1.Robust

  2. 2.Procedural

  3. 3.Distributed

  4. 4.Multithreaded

Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Robust - This option is correct because Java programming language is known for its robustness. It includes features such as strong type checking, exception handling, and automatic memory management, which contribute to its robust nature.

Option B) Procedural - This option is incorrect because Java is not a procedural programming language. It is an object-oriented programming language that follows the principles of encapsulation, inheritance, and polymorphism.

Option C) Distributed - This option is correct because Java programming language supports distributed computing. It provides libraries and frameworks for developing distributed systems, such as Remote Method Invocation (RMI) and Java Message Service (JMS).

Option D) Multithreaded - This option is correct because Java programming language supports multithreading. It includes built-in features and libraries for creating and managing multiple threads, allowing for concurrent execution of tasks.

The correct answer is B) Procedural. This option is correct because Java is not a procedural programming language, but an object-oriented programming language.

- Hide questions