4 pillars Flashcards
This is to make sure that “sensitive” data is hidden from users.
Encapsulation
Ways to do encapsulation
Declare a Class variables/attributes as private
Provide public get and set methods to access and update the value of a private.
Creating new classes based on existing ones.
Inheritance
the class that inherits from another class
subclass (child)
the class being inherited.
superclass(parent)
Allows us to perform a single action in different ways.
Polymorphism
is the process of hiding certain details and showing only essential information to the user.
Abstraction
is a restricted class that cannot be used to create objects (to access it, it must be inherited from another class).
abstract class
can only be used in an abstract class, and it does not have a body. The body is provided by the subclass (inherited from).
abstract method
illegal operation performed by the user which results in the abnormal working of the program
error
true or false:
Programming errors often remain undetected until the program is compiled or executed
true
true or false: Some of the errors inhibit the program from getting compiled or executed. Thus errors should be removed before compiling and executing.”
true
are detected during the execution of the program. Sometimes these are discovered when the user enters an invalid data or data which is not relevant
run time errors
True or false: Runtime errors occur when a program does not contain any syntax errors but asks the computer to do something that the computer is unable to reliably do.During compilation, the compiler has no technique to detect these kinds of errors.
true
detects it while the program is running.
Java virtual machine