0% found this document useful (0 votes)
9 views

Core Java.pptx

Java is a versatile programming language known for its object-oriented features, platform independence, and automatic memory management. Key aspects include rich APIs, multi-threading capabilities, and built-in security measures. The document also covers operators, data types, methods, classes, inheritance, and packages in Java.

Uploaded by

outstanding749
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Core Java.pptx

Java is a versatile programming language known for its object-oriented features, platform independence, and automatic memory management. Key aspects include rich APIs, multi-threading capabilities, and built-in security measures. The document also covers operators, data types, methods, classes, inheritance, and packages in Java.

Uploaded by

outstanding749
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Core

Java
Java is a popular programming language that is widely used for developing desktop,
web, and
mobile applications.
Some of the key features of Java are:
• Object-oriented programming:
Allows developers to create modular and reusable code.
• Platform-independent:
Java code can run on any platform(Windows, Mac, Linux, and others) that has a Java
Virtual Machine (JVM).
• Automatic memory management:
Java uses automatic memory management, which means that developers don't
need to
manage memory manually. The Java Virtual Machine automatically allocates and
deallocates memory.
27-02-2025• Exception handling: UMESH PATHAK 1

Allows developers to handle errors and exceptions effectively.


Key Features Of Java(contd…)
• Rich API
• The Java Standard Library includes APIs for file I/O, networking,
database access, and more.
• Multi-threading:
• Create applications that can perform multiple tasks simultaneously.
Multi-threading can improve application performance and
responsiveness.
• Security:
• Java has built-in security features that help protect against
viruses, malware, and other security threats.

27-02-2025 UMESH PATHAK 2


Operators
1. Unary Operator:
The Java unary operators require only one operand.
• Unary operators are used to perform various operations such as
Incrementing/decrementing a value by one (++,--)
• Inverting the value of a Boolean (!)
2. Arithmetic operator :
• Java arithmetic operators are used to perform addition,
subtraction, multiplication, and division. They act as basic
mathematical operations.

27-02-2025 UMESH PATHAK 3


Operators(contd…..)
4. Assignment operator :
• Java assignment operator is one of the most common
operators.
• It is used to assign the value on its right to the operand on
its left. =,+=,-=,*=, /=,%=,|= are the example of assignment
operator.
5. Bitwise operator :
• The bitwise operator works on bits and performs the bit-by-
bit. operations.
• It can be applied to the integer types, long, int, short, char,
and byte.
• The binary AND operator, binary OR operator, and binary
XOR operator are examples of bitwise operator
27-02-2025 UMESH PATHAK 4
Data Types
Primitive Data Types:
Primitive data types are built-in data types.
• byte: an 8-bit signed integer
• short: a 16-bit signed integer
• int: a 32-bit signed integer
• long: a 64-bit signed integer
• char: a single 16-bit Unicode character
• boolean: a true/false value

27-02-2025 UMESH PATHAK 5


Data Types(contd….)
Non-Primitive Data Types:
String: a sequence of characters
Array: a collection of elements of the same data type
Class: a blueprint for creating objects
Interface: a collection of abstract methods that can be
implemented by classes
These data types can be used to define variables, parameters, and return types
in Java methods.

27-02-2025 UMESH PATHAK 6


Array
• An array in Java is a data structure that allows you to store a
collection of values of the same data type in a contiguous
block of memory.
• Each value in the array is identified by an index, which is a
non-negative integer that represents its position in the array.
• The first element in the array has an index of 0, the second
element has an index of 1, and so on.
dataType[] arrayName = new dataType[arraySize];
int[] myArray = new int[5];
int[] myArray = {1, 2, 3, 4, 5};
27-02-2025 UMESH PATHAK 7
Methods
• In Java, a method is a block of code that performs a specific task and
can be invoked (called) by other parts of a program.
• Methods can be used to encapsulate functionality and make code more
reusable and easier to maintain.
• Access Modifier: specifies the visibility of the method (e.g., public,
private, protected, or default)
• Return Type: specifies the data type of the value returned by the
method (e.g., int, String, boolean, etc.)
• Method Name: specifies the name of the method
• Parameter Type: specifies the data type of the parameters passed to
the method (e.g., int, String, boolean, etc.)
• Parameter Name: specifies the name of the parameters passed to the
method
• Method Body: contains the statements that are executed when the
method is called return value specifies the value returned by the
method (if any)
27-02-2025 UMESH PATHAK 8
Methods (contd…..)

28-02-2025 UMESH PATHAK 9


Class
• In Java, a class is a blueprint for creating objects that
encapsulate data and behavior.
• A class defines the properties (data members) and methods
(functions) that all objects of that class will have.

28-02-2025 UMESH PATHAK 10


Class(contd…)
• Access Modifier: specifies the visibility of the class (e.g.,
public, private, protected, or default)
• class: keyword used to define a class
• Class Name: specifies the name of the class (by convention,
the name should start with a capital letter)
• Data Members: variables that store data within the class
• Constructors: special methods that are used to initialize
objects of the class
• methods: functions that define the behavior of the class
28-02-2025 UMESH PATHAK 11
Example

28-02-2025 UMESH PATHAK 12


Inheritance
• In Java, inheritance is a mechanism that allows one class to inherit the
properties and methods of another class.
• The class that is being inherited from is called the superclass or
parent class, and the class that is inheriting from it is called the
subclass or child class.

• Types of inheritance :
• Single inheritance: It is the inheritance hierarchy wherein one
derived class inherits from one base class.
• Multiple inheritance: It is the inheritance hierarchy wherein
one derived class inherits from multiple base classes.
• .
28-02-2025 UMESH PATHAK 13
Inheritance(contd….)

• Hierarchical inheritance: It is the inheritance


hierarchy wherein multiple subclasses inherit from one
base class.
• Multilevel inheritance: It is the inheritance hierarchy
where in a subclass acts as a base class for other
classes.
• Hybrid inheritance: The inheritance hierarchy that
reflects any legal combination of the other four types
28-02-2025 of inheritance UMESH PATHAK 14
Inheritance(contd….)

28-02-2025 UMESH PATHAK 15


Inheritance(contd….)

28-02-2025 UMESH PATHAK 16


Inheritance(contd….)

28-02-2025 UMESH PATHAK 17


Package
• The package is a mechanism to encapsulate a group of
classes, interfaces, and subpackages. Packages are the way
to organize files into different directories according to their
functionality, usability as well as category.
• Packages also provide a way for separating “design” from
“coding”.
• There are two types of packages in Java :
• User-defined package: The package we create is called
a user-defined package.
• Built-in package: The already defined package like java.
io.*, java.lang.* etc are known as built-in packages.
28-02-2025 UMESH PATHAK 18
Package

28-02-2025 UMESH PATHAK 19

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy