SlideShare a Scribd company logo
OOPS-PPT
TOPIC:ARRAYS,JAVA
PROGRAM,OPERATORS
SHADAN WOMEN’S COLLEGE OF
ENGG. &TECH.
NAME : ANUSHA ASHR
CLASS : B.TECH 2st
YEAR
BRANCH : AI&DS
HT.NO. : 23L51A7205
INDEX
• ARRAYS
• SIMPLE JAVA PROGRAM
• OPERATORS
• TYPES OF OPERATORS
ARRAYS
• An array is a fundamental data structure in computer science that
stores a collection of elements, all of the same type, in contiguous
memory locations. Here are some key points about arrays:
1. Fixed Size: Once an array is created, its size cannot be changed.
2. Indexing: Elements in an array are accessed using indices, starting
from 0.
3. Efficient Access: Arrays allow for efficient access to elements using
their indices.
4. Types: Arrays can be one-dimensional or multi-dimensional (e.g.,
2D arrays).
SIMPLE JAVA PROGRAM
This program defines a class
named HelloWorld with a main method.
The main method is the entry point of
any Java application,
and System.out.println is used to print the
text to the console.
public class HelloWorld {
public static void main(String[]args)
{
System.out.println("Hello,
World!");
}
}
O/P: Hello World!
OPERATOR
• Operators in Java are the symbols used for performing specific
operations in Java. Operators make tasks like addition,
multiplication, etc. which look easy although the implementation of
these tasks is quite complex.
• Operators are the building blocks of Java expressions, allowing you
to perform calculations, comparisons, and more.
TYPES OF OPERATORS
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Assignment Operator
5. Increment Or Decrement Operators
6. Conditional operator
7. Bitwise operator
8. Shift Operator
9. Instance Operator
Arithmetic
Operators Program: Java Program to implement Arithmetic
Operators
class ArithmeticOperators
{
public static void main(String[] args)
Int a=12,b=5;
System.out.printIn("a + b ="+ (a+b));
System.out.printIn(“a- b=" + (a-b));
System.out.printIn("a * b =" + (a * b));
System.out.printIn("a / b =" + (a /b));
System.out.printin("a % b=" + (a%b));
}
•Arithmetic Operators are used for mathematical
calculations.
Relational
Operators
Program: Java Program to implement Relational Operators
class RelationalOperator
public static void main(String[] args)
{
Int a = 10;
intb=3;
intc=5;
System.out.printin("a > b:" + (a> b));
System.out.printin("a < b:" + (a<b));
System.out.printin("a >= b:" + (a >= b));
System.out.println("a <= b:" + (a <= b));
System.out.println("a == c:" + (a == c));
System.out.println("a != c: "+ (a !=c));
}
Relational operators are used to compare
two values and return a true or false result
based upon that comparison. Relational
operators are of 6 types.
Logical
Operators
The Logical operators are used to combine two
or more conditions .Logical operators are of
three types.
1. Logical AND (&&),
2. Logical OR (||)
3. Logician NOT (!)
Example of Logical Operators
class LogicalOp
{
public static void main(String[] args)
{
int x=10;
System.out.printIn(x==10 && x>=5));
System.out.printIn(x==10 || x>=5));
System.out.printin (! (x==10 ));
}
Logical AND(&&):
Logical AND (&&) : Logical AND is denoted by double ampersand characters
(&&).it is used to check the combinations of more than one conditions. if any one
condition false the complete condition becomes false.
Logical OR (||)
Logical OR (||): The logical OR operator ( || ) returns the boolean value
true if either or both operands is true and returns false otherwise.
Logical NOT(!):
Logician NOT (!): Logical NOT is denoted by exclamatory characters
(!), it is used to check the opposite result of any given test condition.
i.e, it makes a true condition false and false condition true.
ASSIGNMENT
OPERATOR
Assignment operators are used to assign a
value (or) an expression (or) a value of a
variable to another variable.
Syntax : variable name=expression (or) value
class AssignmentOperator
{
public static void main(String[] args)
{
int a=4;
int var;
var =a;
System.out.printIn(“var using =: " + var);
var += a;
System.out.printIn("var using +=:" + var);
var *= a;
System.out.printin("var using *=:" + var);
INCREMENT &
DECREMENT
OPERATIORS
The increment and decrement operators are very
useful. ++ and == are called increment and
decrement operators used to add or subtract. Both
are unary operators.
class Increment
{
public static void main(String[] args)
{
int var=5;
System.out.printIn (var++);
System.out.printin (++var);
System.out.printin (var--);
System.out.printIn (--var);
}
CONDITIONAL
OPERATOR
A conditional operator checks the condition and
executes the statement
depending on the condition. Conditional operator
consists of two symbols.
1: question mark (?).
2:colon(:).
class ConditionalOperator
{
public static void main(String[] args)
{
int februaryDays = 29;
String result;
result = (februaryDays == 28) ? "Nota leap
year" : "Leap year";
System.out.println(result);
}
BITWISE
OPERATORS
Bitwise operators are used for manipulating a data at the bit level, also
called as bit level
programming. Bit-level programming mainly consists of 0 and 1.
public class BitwiseAndExample {
public static void main(String[] args) {
int x = 9, y = 8;
// bitwise AND
System.out.println("x & y = " + (x &
y));
}
}
SHIFT
OPERATOR
A shift operator performs bit manipulation on data by
shifting the bits of its first operand right or left.
•Left Shift (<<): Multiplies the operand by 2
for each shift.
•Example: int x = 5; int y = x << 2; // y becomes 20
•Right Shift (>>): Divides the operand by 2
for each shift. Preserves the sign.
•Example: int x = -10; int y = x >> 2; // y becomes -3
•Unsigned Right Shift (>>>): Fills leftmost
bits with 0s.
•Example: int x = -10; int y = x >>> 2; // y becomes 1073741821
Instance
Operator
•Checks if an object is an instance of a class.
•Syntax: expression instanceof type
•Returns: true or false
EXAMPLE:
Object obj = new String("Hello");
if (obj instanceof String) {
System.out.println("obj is a String
object");
}
Thank you

More Related Content

Similar to presentation on array java program operators (20)

Oop using JAVA
Oop using JAVAOop using JAVA
Oop using JAVA
umardanjumamaiwada
 
Arithmetic Operators ____ java.pptx
Arithmetic      Operators ____ java.pptxArithmetic      Operators ____ java.pptx
Arithmetic Operators ____ java.pptx
gnyanadeepa
 
Java unit1 b- Java Operators to Methods
Java  unit1 b- Java Operators to MethodsJava  unit1 b- Java Operators to Methods
Java unit1 b- Java Operators to Methods
SivaSankari36
 
4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt
RithwikRanjan
 
Operators in java By cheena
Operators in java By cheenaOperators in java By cheena
Operators in java By cheena
Chëëñå Båbü
 
L3 operators
L3 operatorsL3 operators
L3 operators
teach4uin
 
L3 operators
L3 operatorsL3 operators
L3 operators
teach4uin
 
L3 operators
L3 operatorsL3 operators
L3 operators
teach4uin
 
Java chapter 3
Java chapter 3Java chapter 3
Java chapter 3
Munsif Ullah
 
Operators in java
Operators in javaOperators in java
Operators in java
yugandhar vadlamudi
 
Java 2
Java 2Java 2
Java 2
Ahmed Hesham
 
itft-Operators in java
itft-Operators in javaitft-Operators in java
itft-Operators in java
Atul Sehdev
 
Operators
OperatorsOperators
Operators
loidasacueza
 
Operator in JAVA
Operator in JAVA Operator in JAVA
Operator in JAVA
KanhaiyaSharma52
 
Java Operators with Simple introduction.pptx
Java Operators with Simple introduction.pptxJava Operators with Simple introduction.pptx
Java Operators with Simple introduction.pptx
kuntadinesh21
 
Pj01 4-operators and control flow
Pj01 4-operators and control flowPj01 4-operators and control flow
Pj01 4-operators and control flow
SasidharaRaoMarrapu
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
Soba Arjun
 
4.Lesson Plan - Java Operators.pdf...pdf
4.Lesson Plan - Java Operators.pdf...pdf4.Lesson Plan - Java Operators.pdf...pdf
4.Lesson Plan - Java Operators.pdf...pdf
AbhishekSingh757567
 
Operators in java presentation
Operators in java presentationOperators in java presentation
Operators in java presentation
kunal kishore
 
ChapterTwoandThreefnfgncvdjhgjshgjdlahgjlhglj.pptx
ChapterTwoandThreefnfgncvdjhgjshgjdlahgjlhglj.pptxChapterTwoandThreefnfgncvdjhgjshgjdlahgjlhglj.pptx
ChapterTwoandThreefnfgncvdjhgjshgjdlahgjlhglj.pptx
berihun18
 
Arithmetic Operators ____ java.pptx
Arithmetic      Operators ____ java.pptxArithmetic      Operators ____ java.pptx
Arithmetic Operators ____ java.pptx
gnyanadeepa
 
Java unit1 b- Java Operators to Methods
Java  unit1 b- Java Operators to MethodsJava  unit1 b- Java Operators to Methods
Java unit1 b- Java Operators to Methods
SivaSankari36
 
4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt
RithwikRanjan
 
L3 operators
L3 operatorsL3 operators
L3 operators
teach4uin
 
L3 operators
L3 operatorsL3 operators
L3 operators
teach4uin
 
L3 operators
L3 operatorsL3 operators
L3 operators
teach4uin
 
itft-Operators in java
itft-Operators in javaitft-Operators in java
itft-Operators in java
Atul Sehdev
 
Java Operators with Simple introduction.pptx
Java Operators with Simple introduction.pptxJava Operators with Simple introduction.pptx
Java Operators with Simple introduction.pptx
kuntadinesh21
 
Pj01 4-operators and control flow
Pj01 4-operators and control flowPj01 4-operators and control flow
Pj01 4-operators and control flow
SasidharaRaoMarrapu
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
Soba Arjun
 
4.Lesson Plan - Java Operators.pdf...pdf
4.Lesson Plan - Java Operators.pdf...pdf4.Lesson Plan - Java Operators.pdf...pdf
4.Lesson Plan - Java Operators.pdf...pdf
AbhishekSingh757567
 
Operators in java presentation
Operators in java presentationOperators in java presentation
Operators in java presentation
kunal kishore
 
ChapterTwoandThreefnfgncvdjhgjshgjdlahgjlhglj.pptx
ChapterTwoandThreefnfgncvdjhgjshgjdlahgjlhglj.pptxChapterTwoandThreefnfgncvdjhgjshgjdlahgjlhglj.pptx
ChapterTwoandThreefnfgncvdjhgjshgjdlahgjlhglj.pptx
berihun18
 

More from anushaashraf20 (8)

power point presentation on spatial database
power point presentation on spatial databasepower point presentation on spatial database
power point presentation on spatial database
anushaashraf20
 
POWERPOINT PRESENTATIION ON INTRODUCTION TO MONOIDS
POWERPOINT PRESENTATIION ON INTRODUCTION TO MONOIDSPOWERPOINT PRESENTATIION ON INTRODUCTION TO MONOIDS
POWERPOINT PRESENTATIION ON INTRODUCTION TO MONOIDS
anushaashraf20
 
power point presentation on the avl trees
power point presentation on the avl treespower point presentation on the avl trees
power point presentation on the avl trees
anushaashraf20
 
PPT ON Wires and Cables IN BASIC ELECTRICAL ENGGINEERING
PPT ON Wires and Cables IN BASIC ELECTRICAL ENGGINEERINGPPT ON Wires and Cables IN BASIC ELECTRICAL ENGGINEERING
PPT ON Wires and Cables IN BASIC ELECTRICAL ENGGINEERING
anushaashraf20
 
Detailed Report on Basics Of Pandas of Python
Detailed Report on Basics Of Pandas of PythonDetailed Report on Basics Of Pandas of Python
Detailed Report on Basics Of Pandas of Python
anushaashraf20
 
POWERPOINT PRESENTATION ON NEWTONS LAW OF MOTION.
POWERPOINT PRESENTATION ON NEWTONS LAW OF MOTION.POWERPOINT PRESENTATION ON NEWTONS LAW OF MOTION.
POWERPOINT PRESENTATION ON NEWTONS LAW OF MOTION.
anushaashraf20
 
POWERPOINT PRESENTATION ON THE INTERNET.
POWERPOINT PRESENTATION ON THE INTERNET.POWERPOINT PRESENTATION ON THE INTERNET.
POWERPOINT PRESENTATION ON THE INTERNET.
anushaashraf20
 
APPENEDING OF DATA TO AN EXISTING FILES.
APPENEDING OF DATA TO AN EXISTING FILES.APPENEDING OF DATA TO AN EXISTING FILES.
APPENEDING OF DATA TO AN EXISTING FILES.
anushaashraf20
 
power point presentation on spatial database
power point presentation on spatial databasepower point presentation on spatial database
power point presentation on spatial database
anushaashraf20
 
POWERPOINT PRESENTATIION ON INTRODUCTION TO MONOIDS
POWERPOINT PRESENTATIION ON INTRODUCTION TO MONOIDSPOWERPOINT PRESENTATIION ON INTRODUCTION TO MONOIDS
POWERPOINT PRESENTATIION ON INTRODUCTION TO MONOIDS
anushaashraf20
 
power point presentation on the avl trees
power point presentation on the avl treespower point presentation on the avl trees
power point presentation on the avl trees
anushaashraf20
 
PPT ON Wires and Cables IN BASIC ELECTRICAL ENGGINEERING
PPT ON Wires and Cables IN BASIC ELECTRICAL ENGGINEERINGPPT ON Wires and Cables IN BASIC ELECTRICAL ENGGINEERING
PPT ON Wires and Cables IN BASIC ELECTRICAL ENGGINEERING
anushaashraf20
 
Detailed Report on Basics Of Pandas of Python
Detailed Report on Basics Of Pandas of PythonDetailed Report on Basics Of Pandas of Python
Detailed Report on Basics Of Pandas of Python
anushaashraf20
 
POWERPOINT PRESENTATION ON NEWTONS LAW OF MOTION.
POWERPOINT PRESENTATION ON NEWTONS LAW OF MOTION.POWERPOINT PRESENTATION ON NEWTONS LAW OF MOTION.
POWERPOINT PRESENTATION ON NEWTONS LAW OF MOTION.
anushaashraf20
 
POWERPOINT PRESENTATION ON THE INTERNET.
POWERPOINT PRESENTATION ON THE INTERNET.POWERPOINT PRESENTATION ON THE INTERNET.
POWERPOINT PRESENTATION ON THE INTERNET.
anushaashraf20
 
APPENEDING OF DATA TO AN EXISTING FILES.
APPENEDING OF DATA TO AN EXISTING FILES.APPENEDING OF DATA TO AN EXISTING FILES.
APPENEDING OF DATA TO AN EXISTING FILES.
anushaashraf20
 
Ad

Recently uploaded (20)

A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
ijfcstjournal
 
Development of Portable Biomass Briquetting Machine (S, A & D)-1.pptx
Development of Portable Biomass Briquetting Machine (S, A & D)-1.pptxDevelopment of Portable Biomass Briquetting Machine (S, A & D)-1.pptx
Development of Portable Biomass Briquetting Machine (S, A & D)-1.pptx
aniket862935
 
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
SharinAbGhani1
 
IntroSlides-June-GDG-Cloud-Munich community [email protected]
IntroSlides-June-GDG-Cloud-Munich community gathering@Netlight.pdfIntroSlides-June-GDG-Cloud-Munich community gathering@Netlight.pdf
IntroSlides-June-GDG-Cloud-Munich community [email protected]
Luiz Carneiro
 
New Microsoft Office Word Documentfrf.docx
New Microsoft Office Word Documentfrf.docxNew Microsoft Office Word Documentfrf.docx
New Microsoft Office Word Documentfrf.docx
misheetasah
 
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journeyRigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Yannis
 
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) ProjectMontreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Alexandra N. Martinez
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
djiceramil
 
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbbTree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
RATNANITINPATIL
 
Structural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant ConversionStructural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant Conversion
DanielRoman285499
 
First Review PPT gfinal gyft ftu liu yrfut go
First Review PPT gfinal gyft  ftu liu yrfut goFirst Review PPT gfinal gyft  ftu liu yrfut go
First Review PPT gfinal gyft ftu liu yrfut go
Sowndarya6
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptxImpurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
May 2025: Top 10 Read Articles Advanced Information Technology
May 2025: Top 10 Read Articles Advanced Information TechnologyMay 2025: Top 10 Read Articles Advanced Information Technology
May 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
operationg systemsdocumentmemorymanagement
operationg systemsdocumentmemorymanagementoperationg systemsdocumentmemorymanagement
operationg systemsdocumentmemorymanagement
SNIGDHAAPPANABHOTLA
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
Journal of Soft Computing in Civil Engineering
 
Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)
pelumiadigun2006
 
Artificial Power 2025 raport krajobrazowy
Artificial Power 2025 raport krajobrazowyArtificial Power 2025 raport krajobrazowy
Artificial Power 2025 raport krajobrazowy
dominikamizerska1
 
3. What is the principles of Teamwork_Module_V1.0.ppt
3. What is the principles of Teamwork_Module_V1.0.ppt3. What is the principles of Teamwork_Module_V1.0.ppt
3. What is the principles of Teamwork_Module_V1.0.ppt
engaash9
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
ijfcstjournal
 
Development of Portable Biomass Briquetting Machine (S, A & D)-1.pptx
Development of Portable Biomass Briquetting Machine (S, A & D)-1.pptxDevelopment of Portable Biomass Briquetting Machine (S, A & D)-1.pptx
Development of Portable Biomass Briquetting Machine (S, A & D)-1.pptx
aniket862935
 
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
SharinAbGhani1
 
New Microsoft Office Word Documentfrf.docx
New Microsoft Office Word Documentfrf.docxNew Microsoft Office Word Documentfrf.docx
New Microsoft Office Word Documentfrf.docx
misheetasah
 
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journeyRigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Yannis
 
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) ProjectMontreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Alexandra N. Martinez
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
djiceramil
 
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbbTree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
RATNANITINPATIL
 
Structural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant ConversionStructural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant Conversion
DanielRoman285499
 
First Review PPT gfinal gyft ftu liu yrfut go
First Review PPT gfinal gyft  ftu liu yrfut goFirst Review PPT gfinal gyft  ftu liu yrfut go
First Review PPT gfinal gyft ftu liu yrfut go
Sowndarya6
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptxImpurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
May 2025: Top 10 Read Articles Advanced Information Technology
May 2025: Top 10 Read Articles Advanced Information TechnologyMay 2025: Top 10 Read Articles Advanced Information Technology
May 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
operationg systemsdocumentmemorymanagement
operationg systemsdocumentmemorymanagementoperationg systemsdocumentmemorymanagement
operationg systemsdocumentmemorymanagement
SNIGDHAAPPANABHOTLA
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)
pelumiadigun2006
 
Artificial Power 2025 raport krajobrazowy
Artificial Power 2025 raport krajobrazowyArtificial Power 2025 raport krajobrazowy
Artificial Power 2025 raport krajobrazowy
dominikamizerska1
 
3. What is the principles of Teamwork_Module_V1.0.ppt
3. What is the principles of Teamwork_Module_V1.0.ppt3. What is the principles of Teamwork_Module_V1.0.ppt
3. What is the principles of Teamwork_Module_V1.0.ppt
engaash9
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
Ad

presentation on array java program operators

  • 1. OOPS-PPT TOPIC:ARRAYS,JAVA PROGRAM,OPERATORS SHADAN WOMEN’S COLLEGE OF ENGG. &TECH. NAME : ANUSHA ASHR CLASS : B.TECH 2st YEAR BRANCH : AI&DS HT.NO. : 23L51A7205
  • 2. INDEX • ARRAYS • SIMPLE JAVA PROGRAM • OPERATORS • TYPES OF OPERATORS
  • 3. ARRAYS • An array is a fundamental data structure in computer science that stores a collection of elements, all of the same type, in contiguous memory locations. Here are some key points about arrays: 1. Fixed Size: Once an array is created, its size cannot be changed. 2. Indexing: Elements in an array are accessed using indices, starting from 0. 3. Efficient Access: Arrays allow for efficient access to elements using their indices. 4. Types: Arrays can be one-dimensional or multi-dimensional (e.g., 2D arrays).
  • 4. SIMPLE JAVA PROGRAM This program defines a class named HelloWorld with a main method. The main method is the entry point of any Java application, and System.out.println is used to print the text to the console. public class HelloWorld { public static void main(String[]args) { System.out.println("Hello, World!"); } } O/P: Hello World!
  • 5. OPERATOR • Operators in Java are the symbols used for performing specific operations in Java. Operators make tasks like addition, multiplication, etc. which look easy although the implementation of these tasks is quite complex. • Operators are the building blocks of Java expressions, allowing you to perform calculations, comparisons, and more.
  • 6. TYPES OF OPERATORS 1. Arithmetic Operators 2. Relational Operators 3. Logical Operators 4. Assignment Operator 5. Increment Or Decrement Operators 6. Conditional operator 7. Bitwise operator 8. Shift Operator 9. Instance Operator
  • 7. Arithmetic Operators Program: Java Program to implement Arithmetic Operators class ArithmeticOperators { public static void main(String[] args) Int a=12,b=5; System.out.printIn("a + b ="+ (a+b)); System.out.printIn(“a- b=" + (a-b)); System.out.printIn("a * b =" + (a * b)); System.out.printIn("a / b =" + (a /b)); System.out.printin("a % b=" + (a%b)); } •Arithmetic Operators are used for mathematical calculations.
  • 8. Relational Operators Program: Java Program to implement Relational Operators class RelationalOperator public static void main(String[] args) { Int a = 10; intb=3; intc=5; System.out.printin("a > b:" + (a> b)); System.out.printin("a < b:" + (a<b)); System.out.printin("a >= b:" + (a >= b)); System.out.println("a <= b:" + (a <= b)); System.out.println("a == c:" + (a == c)); System.out.println("a != c: "+ (a !=c)); } Relational operators are used to compare two values and return a true or false result based upon that comparison. Relational operators are of 6 types.
  • 9. Logical Operators The Logical operators are used to combine two or more conditions .Logical operators are of three types. 1. Logical AND (&&), 2. Logical OR (||) 3. Logician NOT (!) Example of Logical Operators class LogicalOp { public static void main(String[] args) { int x=10; System.out.printIn(x==10 && x>=5)); System.out.printIn(x==10 || x>=5)); System.out.printin (! (x==10 )); }
  • 10. Logical AND(&&): Logical AND (&&) : Logical AND is denoted by double ampersand characters (&&).it is used to check the combinations of more than one conditions. if any one condition false the complete condition becomes false.
  • 11. Logical OR (||) Logical OR (||): The logical OR operator ( || ) returns the boolean value true if either or both operands is true and returns false otherwise.
  • 12. Logical NOT(!): Logician NOT (!): Logical NOT is denoted by exclamatory characters (!), it is used to check the opposite result of any given test condition. i.e, it makes a true condition false and false condition true.
  • 13. ASSIGNMENT OPERATOR Assignment operators are used to assign a value (or) an expression (or) a value of a variable to another variable. Syntax : variable name=expression (or) value class AssignmentOperator { public static void main(String[] args) { int a=4; int var; var =a; System.out.printIn(“var using =: " + var); var += a; System.out.printIn("var using +=:" + var); var *= a; System.out.printin("var using *=:" + var);
  • 14. INCREMENT & DECREMENT OPERATIORS The increment and decrement operators are very useful. ++ and == are called increment and decrement operators used to add or subtract. Both are unary operators. class Increment { public static void main(String[] args) { int var=5; System.out.printIn (var++); System.out.printin (++var); System.out.printin (var--); System.out.printIn (--var); }
  • 15. CONDITIONAL OPERATOR A conditional operator checks the condition and executes the statement depending on the condition. Conditional operator consists of two symbols. 1: question mark (?). 2:colon(:). class ConditionalOperator { public static void main(String[] args) { int februaryDays = 29; String result; result = (februaryDays == 28) ? "Nota leap year" : "Leap year"; System.out.println(result); }
  • 16. BITWISE OPERATORS Bitwise operators are used for manipulating a data at the bit level, also called as bit level programming. Bit-level programming mainly consists of 0 and 1. public class BitwiseAndExample { public static void main(String[] args) { int x = 9, y = 8; // bitwise AND System.out.println("x & y = " + (x & y)); } }
  • 17. SHIFT OPERATOR A shift operator performs bit manipulation on data by shifting the bits of its first operand right or left. •Left Shift (<<): Multiplies the operand by 2 for each shift. •Example: int x = 5; int y = x << 2; // y becomes 20 •Right Shift (>>): Divides the operand by 2 for each shift. Preserves the sign. •Example: int x = -10; int y = x >> 2; // y becomes -3 •Unsigned Right Shift (>>>): Fills leftmost bits with 0s. •Example: int x = -10; int y = x >>> 2; // y becomes 1073741821
  • 18. Instance Operator •Checks if an object is an instance of a class. •Syntax: expression instanceof type •Returns: true or false EXAMPLE: Object obj = new String("Hello"); if (obj instanceof String) { System.out.println("obj is a String object"); }