Why is Java Secure?
Java is considered a secure programming language because of several built-in security features:
Bytecode Verification – Java programs are compiled into bytecode, which is checked by the JVM before execution to prevent malicious code.
Memory Management – Java has automatic garbage collection, which prevents memory leaks and unauthorized memory access.
Sandboxing – Java programs run in a restricted environment (sandbox), preventing access to critical system resources.
No Explicit Pointers – Unlike C/C++, Java does not use pointers, reducing the risk of memory corruption and unauthorized access.
ClassLoader Mechanism – Prevents loading untrusted classes from unknown sources.
Security Manager & APIs – Java provides a Security Manager to restrict file access, network access, and system operations.
Encryption & Authentication – Java provides strong cryptography APIs (e.g., Java Security API, Java Cryptography Extension).
class
$ A class is simply a representation of a type of object. It is the blueprint, plan, or template that describes the details of an object.
object
An object is an instance of a class. It has its own state, behavior, and identity.
What is OOPS?
OOPS is abbreviated as Object-Oriented Programming System, in which programs are considered as a collection of objects. Each object is nothing but an instance of a class.
Write basic concepts of OOPS?
The basic concepts of OOPS are:
Abstraction
Encapsulation
Inheritance
Polymorphism
Encapsulation
Encapsulation is an attribute of an object that contains all hidden data. The hidden data can only be accessed by the members of that class.
Levels of access control:
$ Public
$ Protected
$ Private
$ Internal
$ Protected Internal
Polymorphism
$ Polymorphism means "many forms". It allows a method or function to behave differently based on the object that calls it.
Example: A single function name can have different implementations in different classes (method overriding) or can accept different parameters (method overloading).
Inheritance
Inheritance is a concept where one class shares the structure and behavior defined in another class.
Abstraction
Abstraction is the process of hiding the implementation details from the user and showing only the essential features of an object.
Top comments (0)