SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Muhammad Abrar 36602
Muhammad Zeeshan 36578
Java is a programming language that
produces software for multiple
platforms. When a programmer writes a
Java application, the compiled code
(known as bytecode)
Operators in Java
Java provides many types of operators which can be used
according to the need. They are classified based on the
functionality they provide. Some of the types are-
1.Arithmetic Operators
2.Unary Operators
3.Assignment Operator
4.Relational Operators
5.Logical Operators
 In C, almost everything is in functions
 In Java, almost everything is in classes
 There is often only a class per file
 There must be only one public class per file
 The file name must be the same as the
name of that public class, but with a .java
extension
 A typical Java file looks like:
import java.awt.*;
import java.util.*;
public class SomethingOrOther {
// object definitions go here
. . .
}
This must be in a file named SomethingOrOther.java !
class Simple
{
public static void main(String args[])
{
System. out. println("Hello Java");
}
}
import java.util.Scanner;
public class table
{
public static void main(String args[])
{
int n, c;
System.out.println("Enter an integer to print it's multiplication table");
Scanner in = new Scanner(System.in);
n = in.nextInt();
System.out.println("Multiplication table of " + n);
for (c = 1; c <= 10; c++)
System.out.println(n + "*" + c +" = " + (n*c));
}
}
import java.util.Scanner;
public class LeapYear {
public static void main(String[] args){
int year;
System.out.println("Enter an Year :: ");
Scanner sc = new Scanner(System.in);
year = sc.nextInt();
if (year % 4 == 0)
System.out.println("Specified year is a leap year");
else
System.out.println("Specified year is not a leap year");
}
}

Weitere ähnliche Inhalte

Was ist angesagt?

Java Presentation
Java PresentationJava Presentation
Java Presentation
pm2214
 

Was ist angesagt? (20)

Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Java features
Java featuresJava features
Java features
 
13243967
1324396713243967
13243967
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
3. jvm
3. jvm3. jvm
3. jvm
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
 
Java
JavaJava
Java
 
Java basic introduction
Java basic introductionJava basic introduction
Java basic introduction
 
Java &amp; advanced java
Java &amp; advanced javaJava &amp; advanced java
Java &amp; advanced java
 
JVM
JVMJVM
JVM
 
Java basics training 1
Java basics training 1Java basics training 1
Java basics training 1
 
INTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATIONINTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATION
 
Basic java tutorial
Basic java tutorialBasic java tutorial
Basic java tutorial
 
Java byte code presentation
Java byte code presentationJava byte code presentation
Java byte code presentation
 
Java introduction
Java introductionJava introduction
Java introduction
 
Java interview questions and answers for cognizant By Data Council Pune
Java interview questions and answers for cognizant By Data Council PuneJava interview questions and answers for cognizant By Data Council Pune
Java interview questions and answers for cognizant By Data Council Pune
 
Java programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruJava programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, Mysuru
 

Ähnlich wie Java

R:\ap java\class slides\chapter 1\1 2 java development
R:\ap java\class slides\chapter 1\1 2 java developmentR:\ap java\class slides\chapter 1\1 2 java development
R:\ap java\class slides\chapter 1\1 2 java development
Ken Kretsch
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
sotlsoc
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
Murugesh33
 

Ähnlich wie Java (20)

R:\ap java\class slides\chapter 1\1 2 java development
R:\ap java\class slides\chapter 1\1 2 java developmentR:\ap java\class slides\chapter 1\1 2 java development
R:\ap java\class slides\chapter 1\1 2 java development
 
OOP with Java
OOP with JavaOOP with Java
OOP with Java
 
Top 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfTop 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdf
 
How to run java program without IDE
How to run java program without IDEHow to run java program without IDE
How to run java program without IDE
 
Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
 
Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
 
JAVA Program Examples
JAVA Program ExamplesJAVA Program Examples
JAVA Program Examples
 
Unit of competency
Unit of competencyUnit of competency
Unit of competency
 
Java basic
Java basicJava basic
Java basic
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
Java chapter 1
Java   chapter 1Java   chapter 1
Java chapter 1
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
1_JavIntro
1_JavIntro1_JavIntro
1_JavIntro
 
core java programming
core java programmingcore java programming
core java programming
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
 
Java platform
Java platformJava platform
Java platform
 

Mehr von Abrar ali

Mehr von Abrar ali (17)

SOFTWARE TESTING CHAPTER 8 SE
SOFTWARE TESTING CHAPTER 8 SESOFTWARE TESTING CHAPTER 8 SE
SOFTWARE TESTING CHAPTER 8 SE
 
SOFTWRE REQUIREMNETS SE
 SOFTWRE REQUIREMNETS SE SOFTWRE REQUIREMNETS SE
SOFTWRE REQUIREMNETS SE
 
SE CHAPTER 2 PROCESS MODELS
SE CHAPTER 2 PROCESS MODELSSE CHAPTER 2 PROCESS MODELS
SE CHAPTER 2 PROCESS MODELS
 
AGILE VS Scrum
AGILE VS ScrumAGILE VS Scrum
AGILE VS Scrum
 
SE CHAPTER 1 SOFTWARE ENGINEERING
SE CHAPTER 1 SOFTWARE ENGINEERINGSE CHAPTER 1 SOFTWARE ENGINEERING
SE CHAPTER 1 SOFTWARE ENGINEERING
 
Sql FUNCTIONS
Sql FUNCTIONSSql FUNCTIONS
Sql FUNCTIONS
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
Dbms oracle
Dbms oracle Dbms oracle
Dbms oracle
 
Quicksort ALGORITHM
Quicksort ALGORITHMQuicksort ALGORITHM
Quicksort ALGORITHM
 
Joining
JoiningJoining
Joining
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
Date and Time FUNCTIONS
Date and Time FUNCTIONSDate and Time FUNCTIONS
Date and Time FUNCTIONS
 
Constraints
ConstraintsConstraints
Constraints
 
DML DATA MAINUPULATION LANGUAGE
DML DATA MAINUPULATION LANGUAGEDML DATA MAINUPULATION LANGUAGE
DML DATA MAINUPULATION LANGUAGE
 
DDL DATA DEFINATION LANGUAGE
DDL DATA DEFINATION LANGUAGEDDL DATA DEFINATION LANGUAGE
DDL DATA DEFINATION LANGUAGE
 
Weka presentation
Weka presentationWeka presentation
Weka presentation
 
Machine learning
Machine learningMachine learning
Machine learning
 

Kürzlich hochgeladen

Kürzlich hochgeladen (12)

2024-05-15-Surat Meetup-Hyperautomation.pptx
2024-05-15-Surat Meetup-Hyperautomation.pptx2024-05-15-Surat Meetup-Hyperautomation.pptx
2024-05-15-Surat Meetup-Hyperautomation.pptx
 
Using AI to boost productivity for developers
Using AI to boost productivity for developersUsing AI to boost productivity for developers
Using AI to boost productivity for developers
 
ACM CHT Best Inspection Practices Kinben Innovation MIC Slideshare.pdf
ACM CHT Best Inspection Practices Kinben Innovation MIC Slideshare.pdfACM CHT Best Inspection Practices Kinben Innovation MIC Slideshare.pdf
ACM CHT Best Inspection Practices Kinben Innovation MIC Slideshare.pdf
 
STM valmiusseminaari 26-04-2024 PUUMALAINEN Ajankohtaista kansainvälisestä yh...
STM valmiusseminaari 26-04-2024 PUUMALAINEN Ajankohtaista kansainvälisestä yh...STM valmiusseminaari 26-04-2024 PUUMALAINEN Ajankohtaista kansainvälisestä yh...
STM valmiusseminaari 26-04-2024 PUUMALAINEN Ajankohtaista kansainvälisestä yh...
 
DAY 0 8 A Revelation 05-19-2024 PPT.pptx
DAY 0 8 A Revelation 05-19-2024 PPT.pptxDAY 0 8 A Revelation 05-19-2024 PPT.pptx
DAY 0 8 A Revelation 05-19-2024 PPT.pptx
 
"I hear you": Moving beyond empathy in UXR
"I hear you": Moving beyond empathy in UXR"I hear you": Moving beyond empathy in UXR
"I hear you": Moving beyond empathy in UXR
 
TSM unit 5 Toxicokinetics seminar by Ansari Aashif Raza.pptx
TSM unit 5 Toxicokinetics seminar by  Ansari Aashif Raza.pptxTSM unit 5 Toxicokinetics seminar by  Ansari Aashif Raza.pptx
TSM unit 5 Toxicokinetics seminar by Ansari Aashif Raza.pptx
 
Databricks Machine Learning Associate Exam Dumps 2024.pdf
Databricks Machine Learning Associate Exam Dumps 2024.pdfDatabricks Machine Learning Associate Exam Dumps 2024.pdf
Databricks Machine Learning Associate Exam Dumps 2024.pdf
 
The Concession of Asaba International Airport: Balancing Politics and Policy ...
The Concession of Asaba International Airport: Balancing Politics and Policy ...The Concession of Asaba International Airport: Balancing Politics and Policy ...
The Concession of Asaba International Airport: Balancing Politics and Policy ...
 
SaaStr Workshop Wednesday with CEO of Guru
SaaStr Workshop Wednesday with CEO of GuruSaaStr Workshop Wednesday with CEO of Guru
SaaStr Workshop Wednesday with CEO of Guru
 
2024 mega trends for the digital workplace - FINAL.pdf
2024 mega trends for the digital workplace - FINAL.pdf2024 mega trends for the digital workplace - FINAL.pdf
2024 mega trends for the digital workplace - FINAL.pdf
 
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdfMicrosoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
 

Java

  • 2. Java is a programming language that produces software for multiple platforms. When a programmer writes a Java application, the compiled code (known as bytecode)
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Operators in Java Java provides many types of operators which can be used according to the need. They are classified based on the functionality they provide. Some of the types are- 1.Arithmetic Operators 2.Unary Operators 3.Assignment Operator 4.Relational Operators 5.Logical Operators
  • 8.  In C, almost everything is in functions  In Java, almost everything is in classes  There is often only a class per file  There must be only one public class per file  The file name must be the same as the name of that public class, but with a .java extension
  • 9.  A typical Java file looks like: import java.awt.*; import java.util.*; public class SomethingOrOther { // object definitions go here . . . } This must be in a file named SomethingOrOther.java !
  • 10.
  • 11.
  • 12. class Simple { public static void main(String args[]) { System. out. println("Hello Java"); } }
  • 13. import java.util.Scanner; public class table { public static void main(String args[]) { int n, c; System.out.println("Enter an integer to print it's multiplication table"); Scanner in = new Scanner(System.in); n = in.nextInt(); System.out.println("Multiplication table of " + n); for (c = 1; c <= 10; c++) System.out.println(n + "*" + c +" = " + (n*c)); } }
  • 14. import java.util.Scanner; public class LeapYear { public static void main(String[] args){ int year; System.out.println("Enter an Year :: "); Scanner sc = new Scanner(System.in); year = sc.nextInt(); if (year % 4 == 0) System.out.println("Specified year is a leap year"); else System.out.println("Specified year is not a leap year"); } }