java
java
-high level, oop lang -platform independent (run on any device with a jvm)
4)Explain the main principles of object-oriented programming (OOP) and how they
apply to Java.
- main principles of OOP are encapsulation, inheritance, and polymorphism
- implemented through classes, objects, inheritance, polymorphism, abstraction, and
encapsulation.
21)Inheritance?
-mechanism by which a class can inherit attributes and methods from another
class.it increase code reusability and it also achives runtime polymorphism
22)Polymorphism?
-ability of objects to take on multiple forms.
-classified into two types based on the time when the call to the object or
function is resolved.
-Compile-time Polymorphism (Static Polymorphism):
Compile-time polymorphism refers to the polymorphic behavior that is resolved at
compile time.
It is achieved through method overloding, where multiple methods with the same name
but different parameter lists are defined within the same class.
The appropriate method to execute is determined by the compiler based on the number
and types of arguments passed to the method.
-Runtime Polymorphism (Dynamic Polymorphism):
Runtime polymorphism refers to the polymorphic behavior that is resolved at
runtime.
It is achieved through method overriding, where a subclass provides a specific
implementation of a method that is already defined in its superclass.
The appropriate method to execute is determined by the JVM based on the type of the
object at runtime.
23)Abstraction?
-simplifies complex systems by modeling classes based on their essential
characteristics and ignoring irrelevant details. It enables the creation of
abstract data types and interfaces, allowing for code reuse and modular design.
BigInteger is particularly useful when dealing with very large numbers that cannot
be represented by the built-in integer types. It supports operations such as
addition, subtraction, multiplication, division, and exponentiation on large
integers, without loss of precision.