DEV Community

Sugumar R
Sugumar R

Posted on

Day 2: Basic opps consept

Why is Java Secure?

Java is considered a secure programming language because of several built-in security features:

  1. Bytecode Verification – Java programs are compiled into bytecode, which is checked by the JVM before execution to prevent malicious code.

  2. Memory Management – Java has automatic garbage collection, which prevents memory leaks and unauthorized memory access.

  3. Sandboxing – Java programs run in a restricted environment (sandbox), preventing access to critical system resources.

  4. No Explicit Pointers – Unlike C/C++, Java does not use pointers, reducing the risk of memory corruption and unauthorized access.

  5. ClassLoader Mechanism – Prevents loading untrusted classes from unknown sources.

  6. Security Manager & APIs – Java provides a Security Manager to restrict file access, network access, and system operations.

  7. 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:

  1. Abstraction

  2. Encapsulation

  3. Inheritance

  4. 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.

Image description

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.

Image description

AWS Q Developer image

Your AI Code Assistant

Generate and update README files, create data-flow diagrams, and keep your project fully documented. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

DEV shines when you're signed in, unlocking a customized experience with features like dark mode!

Okay