Question
Which of the following best describes the concept of
abstraction in object-oriented programming (OOP)?ÂSolution
Abstraction in OOP is a fundamental concept that involves hiding the complex internal details of a system and exposing only what is necessary to the user. This simplifies the interaction with objects and promotes reusability, as the user can interact with high-level methods without needing to understand their internal workings. It allows developers to create complex systems while maintaining a clear and simplified interface. In practical terms, abstraction can be achieved through the use of abstract classes and interfaces, where only the essential behavior is defined, and the details are hidden. Why other options are wrong: A) This describes encapsulation, not abstraction, which involves combining data and methods into a class. C) This is method overloading, where multiple methods share the same name but differ in parameters or implementation. D) This refers to inheritance and polymorphism, not abstraction. E) This describes polymorphism, which allows objects to behave differently based on the context.
In a 5-stage pipeline (Fetch, Decode, Execute, Memory, Write-back), how many instructions can be in various stages of processing at the same time?
A transformer has a primary coil with 300 turns and a secondary coil with 150 turns. If the primary voltage is 240V, calculate the secondary voltage.
Which of the following is a common problem that synchronization mechanisms address in multi-threaded or multi-process environments?
What happens when a program accesses data that is not currently in physical memory (RAM) due to virtual memory management?
Which of the following is not a valid keyword in C++ language?
XML is designed to ____ and ____ data)
What is the main purpose of a digital signature in public key cryptography?
The best case time complexity of selection sort?
What is the space complexity of an algorithm?
Which functions are declared inside a class have to be defined separately outside the class?