Faculty Of Computers And Information Mansoura 3

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Mgabr
M
Mgabr
Community Contributor
Quizzes Created: 4 | Total Attempts: 8,682
| Attempts: 655 | Questions: 28
Please wait...
Question 1 / 28
0 %
0/100
Score 0/100
1. Is eye color property of human being?

Explanation

Eye color is a property of human beings. It is determined by the amount and type of pigments present in the iris of the eye. The variation in eye color, such as blue, green, brown, etc., is a result of genetic factors. Eye color is an inherited trait that can be passed down from parents to their offspring. Therefore, it can be considered as a property that distinguishes individuals and is a characteristic of human beings.

Submit
Please wait...
About This Quiz
Faculty Of Computers And Information Mansoura 3 - Quiz

Faculty of Computers and Information
Mansoura - Universtiy 

Questions for Chapter3 DR / Mohamed Mahfouz
prepared by
 Eng :- Ahmed Eldeep

Personalize your quiz and earn a certificate with your name on it!
2. What is an Object?

Explanation

An object is a combination of message and data. In object-oriented programming, an object is an instance of a class that can receive messages, perform tasks, and store data. The message represents a request or instruction that is sent to the object, and the data represents the state or properties of the object. By combining both message handling and data storage, objects provide a way to encapsulate behavior and data together, allowing for modular and reusable code.

Submit
3. An inner class can be private.

Explanation

An inner class can be declared as private to limit its access only within the outer class. This means that the inner class cannot be accessed or instantiated from outside the outer class. It is often used to encapsulate functionality or data that is only relevant or needed within the context of the outer class. By making the inner class private, it helps to enforce encapsulation and maintain the integrity of the outer class's implementation.

Submit
4. The return data type of void means? 

Explanation

The return data type of void means that no data type is returned. In programming, when a function or method is declared as void, it indicates that the function does not return any value. This is useful for functions that perform actions or operations without needing to return a result. Therefore, when a function has a void return type, it means that no data type is returned.

Submit
5. Object Oriented Programming is characterized by using

Explanation

Object Oriented Programming (OOP) is a programming paradigm that focuses on the concept of objects. Encapsulation is one of the key principles of OOP, which involves bundling data and methods together within a class to hide the internal details and provide a clean interface. Inheritance allows classes to inherit properties and methods from other classes, promoting code reusability and creating a hierarchical relationship between classes. Polymorphism enables objects of different classes to be treated as objects of a common superclass, allowing for flexibility and extensibility in the code. Therefore, all of these features - encapsulation, inheritance, and polymorphism - are characteristics of Object Oriented Programming.

Submit
6. What is an Encapsulation?

Explanation

Encapsulation refers to the concept of bundling data and methods together into a single unit, known as a class or object. This allows for the hiding of internal details and the protection of data from outside interference. By encapsulating related components together, it becomes easier to manage and maintain the code, as well as ensuring data integrity and security.

Submit
7. What are the advantages of inheritance? 

Explanation

Inheritance has two main advantages: code reusability and the ability to reuse proven and debugged software. By inheriting from a parent class, a child class can inherit its methods and attributes, allowing for code reusability and saving time in program development. Additionally, by reusing established and tested software, the chances of encountering problems after a system becomes functional are reduced. Therefore, the correct answer is "Both A & B."

Submit
8. A class can have many methods with the same name, as long as the number of parameters is different.  This is known as: 

Explanation

Method overloading is the ability to have multiple methods with the same name in a class, as long as they have a different number of parameters. This allows for flexibility and convenience in programming, as different versions of the same method can be used depending on the number and types of arguments passed. It helps improve code readability and maintainability by grouping related methods under the same name.

Submit
9. ___________ is a blueprint or prototype that defines the variables and the methods common to all objects of a certain kind.  Select the best word to complete this sentence

Explanation

A class is a blueprint or prototype that defines the variables and the methods common to all objects of a certain kind. It serves as a template or a blueprint for creating objects of that class. A class encapsulates the data and behavior of an object, allowing multiple instances of the class to be created. It defines the structure and behavior of objects, including their properties (variables) and actions (methods). In object-oriented programming, a class is used to create objects, which are instances of that class.

Submit
10. Polymorphism reduces the effort required to extend an object system by

Explanation

Polymorphism allows different objects to be treated as the same type, even if they have different underlying implementations. This means that different operations can be performed on these objects using the same method name, simplifying the code and reducing the effort required to extend the object system. By enabling multiple operations to share the same name, polymorphism promotes code reuse and flexibility. It does not couple objects together more tightly, make objects more dependent on each other, or remove the barriers imposed by encapsulation.

Submit
11. -(A/An) ____________ is a contract in the form of a collection of method and constant declarations. When a class implements (a/an) ____________, it promises to implement all of the methods declared in that ____________.  Select the best word to complete this sentence.

Explanation

An interface is a contract in the form of a collection of method and constant declarations. When a class implements an interface, it promises to implement all of the methods declared in that interface.

Submit
12. What is the difference between Assignment and Initialization?

Explanation

Assignment and initialization are two different concepts in programming. Assignment refers to the process of giving a value to a variable, which can be done multiple times. On the other hand, initialization is the act of giving an initial value to a variable, which can only be done once at the time of declaration. Therefore, the correct answer states that assignment can be done multiple times, while initialization can only be done once.

Submit
13. Anonymous classes cannot have explicit constructors.

Explanation

Anonymous classes are defined and instantiated at the same time, without explicitly declaring a class. Since they do not have a class name, they cannot have explicit constructors. Instead, they can only use the default constructor provided by the compiler. Therefore, the statement "Anonymous classes cannot have explicit constructors" is true.

Submit
14. A method will affect only a particular object to which it is specified.

Explanation

This statement is true because when a method is defined in a class, it can only be called on objects of that class. Each object of the class will have its own copy of the instance variables, and when a method is called on a specific object, it will only affect the data within that object. Other objects of the same class will have their own separate data and will not be affected by the method call on a different object.

Submit
15. Can overloaded methods be override too?

Explanation

Overloaded methods and overridden methods are two different concepts in object-oriented programming. Overloaded methods have the same name but different parameters within the same class, while overridden methods have the same name and parameters in different classes, where a subclass provides its own implementation of a method that is already defined in its superclass. Therefore, it is possible to have both overloaded and overridden methods in a program.

Submit
16. What is anonymous class?

Explanation

An anonymous class is a class that is defined inside a method without a name. It can be instantiated and declared in the same place, and it cannot have explicit constructors. Therefore, the correct answer is "Both A & B" because both statements A and B accurately describe an anonymous class.

Submit
17. Which statements are not correct about Objects? 

Explanation

The statement that objects do not permit encapsulation is not correct. Encapsulation is a fundamental principle in object-oriented programming that allows data and methods to be bundled together within an object, and objects are the primary way to achieve encapsulation. Objects provide a way to encapsulate data and behavior into a single unit, allowing for better organization and modularity in code.

Submit
18. If an attribute is private, which methods have access to it?

Explanation

If an attribute is private, it means that it can only be accessed within the same class. Other classes or methods outside of the class cannot access this private attribute. Therefore, the correct answer is that only methods defined in the same class have access to the private attribute.

Submit
19. Can we create an object for an interface?

Explanation

Yes, we can create an object for an interface. In Java, an interface is a reference type that can be used to achieve abstraction and multiple inheritance. Although we cannot directly create objects of an interface, we can create objects of a class that implements the interface. These objects can be assigned to the interface type, allowing us to access the methods defined in the interface through the object. This enables us to achieve polymorphism and loose coupling in our code.

Submit
20. What is inner class ?

Explanation

An inner class is a class that is defined within another class. It can be defined within the body of another class or within a method of the outer class. Therefore, the correct answer is both A and B, as inner classes can be defined in other classes as well as in methods.

Submit
21. Can abstract classes be inherited?

Explanation

Abstract classes can be inherited. In object-oriented programming, an abstract class is a class that cannot be instantiated and is meant to be subclassed. Subclasses of an abstract class inherit its properties and methods, and they can provide their own implementation for the abstract methods declared in the abstract class. This allows for code reuse and the ability to define common behavior in the abstract class while allowing for customization in the subclasses. Therefore, abstract classes can be inherited by other classes.

Submit
22. What is a class?

Explanation

A class is an abstract representation of something with certain properties and abilities. In object-oriented programming, a class is a blueprint or template for creating objects. It defines the properties (attributes) that an object of that class will have, as well as the methods (abilities) that the object can perform. The answer correctly describes a class as an abstract representation, indicating that it is not a concrete or physical entity, but rather a conceptual model. Additionally, it mentions that a class has certain properties and abilities, which aligns with the definition of a class in object-oriented programming.

Submit
23. What is an aggregate object?

Explanation

An aggregate object is an object instance that contains other objects. This means that the aggregate object is composed of multiple objects, which can be accessed and manipulated through the aggregate object. This allows for a higher level of abstraction and organization in the code, as related objects can be grouped together within the aggregate object.

Submit
24. Which of the following is example of encapsulation

Explanation

The correct answer is "Car" because encapsulation refers to the process of hiding the internal details and exposing only the necessary information to the outside world. In the case of a car, it encapsulates various components such as the engine, transmission, and suspension system, hiding their complexities and providing a simplified interface to the user. The user does not need to know the intricate workings of the car's internal components, but can still interact with it through the exposed features like the steering wheel, accelerator, and brakes.

Submit
25. Can we override the main method?

Explanation

The main method in Java is the entry point of any program. It is a special method that is automatically called when the program starts. Since it is a predefined method in the Java language, it cannot be overridden. Therefore, the correct answer is False.

Submit
26. Which of the following are not in composition in " Car as a system"

Explanation

The correct answer is "Car and music system" because a music system is not an essential component of a car's composition. While a car typically includes features such as seat covers, color, and an engine, a music system is an optional accessory that can be added or removed from the car.

Submit
27. Polymorphism enables you to program "in the specific" rather than "in the general."

Explanation

Polymorphism enables you to program "in the specific" rather than "in the general" because it allows objects of different classes to be treated as objects of a common superclass. This means that you can write code that operates on the superclass, and it will automatically work with any subclass objects that inherit from it. This allows for more flexible and reusable code, as you can write generic methods that can be used with different types of objects without needing to know their specific implementation details.

Submit
28. Object Oriented Programming

Explanation

Object Oriented Programming (OOP) simulates real life by allowing programmers to model real-world objects and their interactions. It focuses on encapsulating data and behavior within objects, which can interact with each other through defined interfaces. This approach mirrors how objects in the real world interact and communicate with each other. By simulating real-life scenarios, OOP helps programmers create more intuitive and understandable code, making it easier to design, maintain, and debug applications.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 23, 2011
    Quiz Created by
    Mgabr
Cancel
  • All
    All (28)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Is eye color property of human being?
What is an Object?
An inner class can be private.
The return data type of void means? 
Object Oriented Programming is characterized by using
What is an Encapsulation?
What are the advantages of inheritance? 
A class can have many methods with the same name, as long as the...
___________ is a blueprint or prototype that defines the variables and...
Polymorphism reduces the effort required to extend an object system by
-(A/An) ____________ is a contract in the form of a collection of...
What is the difference between Assignment and Initialization?
Anonymous classes cannot have explicit constructors.
A method will affect only a particular object to which it is...
Can overloaded methods be override too?
What is anonymous class?
Which statements are not correct about Objects? 
If an attribute is private, which methods have access to it?
Can we create an object for an interface?
What is inner class ?
Can abstract classes be inherited?
What is a class?
What is an aggregate object?
Which of the following is example of encapsulation
Can we override the main method?
Which of the following are not in composition in " Car as a...
Polymorphism enables you to program "in the specific" rather than "in...
Object Oriented Programming
Alert!

Advertisement