Java Core Flashcards
What is Java?
Java is a programming language developed under the concept of WORA (Write Once Run Anywhere). Java is statically typed and strong typed. Java is an object oriented programming language.
What it means for a language to be statically typed?
Statically typed programming languages do type checking (i.e. the process of verifying and enforcing the constraints of types) at compile-time as opposed to run-time. Dynamically typed programming languages do type checking at run-time as opposed to compile-time.
What it means for a language to be strongly typed?
A strongly-typed language is one in which variables are bound to specific data types, and will result in type errors if types do not match up as expected in the expression.
What is OOP?
Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects”, which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods).
What are the 4 pillars of OOP?
Abstraction, Polymorphism, Inheritance, Encapsulation
What is Abstraction?
Its main goal is to handle complexity by hiding unnecessary details from the user. That enables the user to implement more complex logic on top of the provided abstraction without understanding or even thinking about all the hidden complexity.
What is Polymorphism?
It describes the concept that objects of different types can be accessed through the same interface. Each type can provide its own, independent implementation of this interface.
What is Inheritance?
Inheritance can be defined as the process where one class acquires the properties (methods and fields) of another. … The class which inherits the properties of other is known as subclass (derived class, child class) and the class whose properties are inherited is known as superclass.
What is Encapsulation?
Encapsulation is defined as the wrapping up of data under a single unit. It is the mechanism that binds together code and the data it manipulates.Other way to think about encapsulation is, it is a protective shield that prevents the data from being accessed by the code outside this shield.
What is the Single Responsability Principle?
In programming, the Single Responsibility Principle states that every module or class should have responsibility over a single part of the functionality provided by the software.
What is the Open/Closed Principle?
In programming, the open/closed principle states that software entities (classes, modules, functions, etc.) should be open for extensions, but closed for modification.
What is the Liskov Substitution Principle?
it states that objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
What is the Interface Segregation Principle?
The interface segregation principle states that no client should be forced to depend on methods it does not use.
What is the Dependency Inversion Principle?
This principle states that high-level modules should not depend on low-level modules. Both should depend on abstractions. And abstractions should not depend on details. Details should depend on abstractions.
What is a Thread?
A thread is an independent path of execution within a program.