SlideShare a Scribd company logo
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)
Java
Java
Java
Java
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 !
Java
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");
}
}

More Related Content

PPT
1 2 java development
PPTX
Features of JAVA Programming Language.
PPTX
Java fundamentals 2
PPTX
Java architecture
PPTX
Lecture - 1 introduction to java
DOCX
Java and its features
DOCX
JDK,JRE,JVM
PPTX
Jdk,jre,jvm
1 2 java development
Features of JAVA Programming Language.
Java fundamentals 2
Java architecture
Lecture - 1 introduction to java
Java and its features
JDK,JRE,JVM
Jdk,jre,jvm

What's hot (20)

PPTX
Java virtual machine
PDF
PPT
Fundamentals of JAVA
PPTX
Java features
PPT
13243967
PPT
Java Presentation
PDF
PDF
Core Java Tutorial
PPTX
PPT
Java basic introduction
PPSX
Java &amp; advanced java
PPT
INTRODUCTION TO JAVA APPLICATION
PDF
Basic java tutorial
PPTX
Java byte code presentation
PPT
Java introduction
DOCX
Java interview questions and answers for cognizant By Data Council Pune
PDF
Java programming material for beginners by Nithin, VVCE, Mysuru
Java virtual machine
Fundamentals of JAVA
Java features
13243967
Java Presentation
Core Java Tutorial
Java basic introduction
Java &amp; advanced java
INTRODUCTION TO JAVA APPLICATION
Basic java tutorial
Java byte code presentation
Java introduction
Java interview questions and answers for cognizant By Data Council Pune
Java programming material for beginners by Nithin, VVCE, Mysuru
Ad

Similar to Java (20)

PPT
R:\ap java\class slides\chapter 1\1 2 java development
PPTX
Object Oriented Programming unit 1 content for students
PPTX
OOP with Java
PDF
Top 10 Important Core Java Interview questions and answers.pdf
PPTX
How to run java program without IDE
PPTX
Java For beginners and CSIT and IT students
PPT
Basic java part_ii
PDF
JAVA Program Examples
DOCX
Unit of competency
PPT
Java basic
PPTX
Chapter 2.1
PPTX
java basic for begginers
PPTX
JAVA_Day1_BasicIntroduction.pptx
PPTX
JAVAPart1_BasicIntroduction.pptx
PPTX
oop unit1.pptx
PDF
Java chapter 1
PPTX
object oriented programming unit one ppt
PPTX
brief introduction to core java programming.pptx
PPTX
PPTX
1_JavIntro
R:\ap java\class slides\chapter 1\1 2 java development
Object Oriented Programming unit 1 content for students
OOP with Java
Top 10 Important Core Java Interview questions and answers.pdf
How to run java program without IDE
Java For beginners and CSIT and IT students
Basic java part_ii
JAVA Program Examples
Unit of competency
Java basic
Chapter 2.1
java basic for begginers
JAVA_Day1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
oop unit1.pptx
Java chapter 1
object oriented programming unit one ppt
brief introduction to core java programming.pptx
1_JavIntro
Ad

More from Abrar ali (17)

PPTX
SOFTWARE TESTING CHAPTER 8 SE
PPT
SOFTWRE REQUIREMNETS SE
PPT
SE CHAPTER 2 PROCESS MODELS
PPTX
AGILE VS Scrum
PPT
SE CHAPTER 1 SOFTWARE ENGINEERING
PPTX
Sql FUNCTIONS
PPTX
Database COMPLETE
PPT
Dbms oracle
PPTX
Quicksort ALGORITHM
PPTX
Joining
PPTX
Greedy algorithm
PPTX
Date and Time FUNCTIONS
PPTX
Constraints
PPTX
DML DATA MAINUPULATION LANGUAGE
PPTX
DDL DATA DEFINATION LANGUAGE
PPTX
Weka presentation
PPTX
Machine learning
SOFTWARE TESTING CHAPTER 8 SE
SOFTWRE REQUIREMNETS SE
SE CHAPTER 2 PROCESS MODELS
AGILE VS Scrum
SE CHAPTER 1 SOFTWARE ENGINEERING
Sql FUNCTIONS
Database COMPLETE
Dbms oracle
Quicksort ALGORITHM
Joining
Greedy algorithm
Date and Time FUNCTIONS
Constraints
DML DATA MAINUPULATION LANGUAGE
DDL DATA DEFINATION LANGUAGE
Weka presentation
Machine learning

Recently uploaded (20)

PPT
The Effect of Human Resource Management Practice on Organizational Performanc...
PPTX
chapter8-180915055454bycuufucdghrwtrt.pptx
PPTX
_ISO_Presentation_ISO 9001 and 45001.pptx
PDF
natwest.pdf company description and business model
PPTX
Self management and self evaluation presentation
PPTX
Non-Verbal-Communication .mh.pdf_110245_compressed.pptx
PDF
Swiggy’s Playbook: UX, Logistics & Monetization
PPTX
Intro to ISO 9001 2015.pptx wareness raising
PDF
Tunisia's Founding Father(s) Pitch-Deck 2022.pdf
PPTX
Learning-Plan-5-Policies-and-Practices.pptx
PPTX
2025-08-10 Joseph 02 (shared slides).pptx
PPTX
lesson6-211001025531lesson plan ppt.pptx
PPTX
An Unlikely Response 08 10 2025.pptx
PPTX
Project and change Managment: short video sequences for IBA
PDF
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
PPTX
Presentation for DGJV QMS (PQP)_12.03.2025.pptx
PPTX
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
PPTX
Role and Responsibilities of Bangladesh Coast Guard Base, Mongla Challenges
PPTX
Human Mind & its character Characteristics
PDF
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf
The Effect of Human Resource Management Practice on Organizational Performanc...
chapter8-180915055454bycuufucdghrwtrt.pptx
_ISO_Presentation_ISO 9001 and 45001.pptx
natwest.pdf company description and business model
Self management and self evaluation presentation
Non-Verbal-Communication .mh.pdf_110245_compressed.pptx
Swiggy’s Playbook: UX, Logistics & Monetization
Intro to ISO 9001 2015.pptx wareness raising
Tunisia's Founding Father(s) Pitch-Deck 2022.pdf
Learning-Plan-5-Policies-and-Practices.pptx
2025-08-10 Joseph 02 (shared slides).pptx
lesson6-211001025531lesson plan ppt.pptx
An Unlikely Response 08 10 2025.pptx
Project and change Managment: short video sequences for IBA
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
Presentation for DGJV QMS (PQP)_12.03.2025.pptx
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
Role and Responsibilities of Bangladesh Coast Guard Base, Mongla Challenges
Human Mind & its character Characteristics
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).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)
  • 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 !
  • 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"); } }