Programming Concepts Flashcards
What are the four principles of Object-Orientated Programming?
The four main principles of OOP is encapsulation, abstraction, polymorphism, and inheritance.
Explain what Encapsulation is in Object-Orientated Programming?
Encapsulation refers to the bundling of data and behaviours into a single unit. A class is an example of encapsulation in that it consists of data and methods that have been bundled into a single unit. Encapsulation also allows for direct access of components within the object to be restricted, such as state values for the variables in the object.
What is Abstraction in Object-Orientated Programming?
Abstraction is where irrelevant data about an object is hidden. This helps to reduce complexity by only presenting a specific selection of data and behaviours, that are specific to a particular use of the originating entity.
What’s the main difference between encapsulation and abstraction in Object-Orientated Programming?
Abstraction focuses on the observable behaviour of an object, whilst encapsulation focuses on the implementation that gives rise to this behaviour.
What is Polymorphism in Object-Orientated Programming?
Polymorphism allows to you replace, by method overriding, the implementation of inherited public and protected methods.
What is the effect of using the ‘final’ word keyword in variables, methods, and classes.
In variables, using the keyword final makes the variable constant, which means that its value cannot be changed. The keyword final in methods prevents method overriding in subclasses, whilst in classes it prevents inheritance of the class.
What is inheritance in Object-Orientated Programming?
Inheritance is where classes can inherit properties and behaviours from parent or super classes, which helps to create a hierarchy of classes that share a set of attributes and methods.
What are microservices?
Microservices is an architectural style that structures an application as a collection of services that are highly maintainable and testable, loosely coupled, independently deployable, and organised around business capabilities.
What is a REST API?
A REST API is an application programming interface that conforms to the contraints of the REST architectural style and allows for interaction with RESTful web services.
What does REST stand for?
REST stands for Representational State Transfer.
What does JSON stand for?
JSON stands for JavaScript Object Notation.
What are the basic steps for connecting to a database?
First you need to register the driver class (if using java), create a connection, execute a query, then close the connection if needed.