SlideShare a Scribd company logo
1 of 30
U Nyein OoU Nyein Oo
Director/COO(IT)Director/COO(IT)
Myanma Computer Co., LtdMyanma Computer Co., Ltd
IADCS Diploma CourseIADCS Diploma Course
Advanced Java
Copyright : MCC ( Advanced Java
Programming) 2
Subject Content
1. Introduction to Java & OOP
2. Programming in Java
3. Types- Primitive, Reference and Garbage Collection
4. Classes and Packages with OO Programming
5. Exception Handling with Java
6. Object Cloning and RTTI
7. Programming I/O within Java
Copyright : MCC ( Advanced Java
Programming) 3
Subject Content (cont)
8. Object & Classes in Java
9. Multithreading
10. Introduction to GUI
11. Programming Windows and Events
12. Client side Java, Applets and JavaBeans
13. Network Programming with Java
14. Programming Server-side Java
Copyright : MCC ( Advanced Java
Programming) 4
• Inline sound that play in real time whenever
a user loads a page
• Music that plays in the background on a page
• Cartoon Style Animations
• Real time Video
• Multiplayer interactive games
Application of Java
Copyright : MCC ( Advanced Java
Programming) 5
Introduction to Java
 - Object Oriented Programming
- Developed by Sun Microsystems
- At USA in 1991 by James Gosling.
 Originally called Oak
- Platform Independent Language.
 Internet Programming Language.
Copyright : MCC ( Advanced Java
Programming) 6
Features of Java
 Simple
 Object-oriented
 Platform-independent
 Robust
 Safe (Secure)
 High Performance
 Multithreaded
 Distributed
 Dynamic
Copyright : MCC ( Advanced Java
Programming) 7
Types of Java Programs
•Applications
•Command Line
•GUI
•Applets
•Servlets
•Packages
•Database Applications
Copyright : MCC ( Advanced Java
Programming) 8
Command Line Application
// Sample Java Program
class HelloWorld{
public static void main(String args[]) {
System.out.println(“Helloworld ”);
}
}
Copyright : MCC ( Advanced Java
Programming) 9
Compilation code in Java
Copyright : MCC ( Advanced Java
Programming) 10
Traditional way of compilation
Copyright : MCC ( Advanced Java
Programming) 11
Compiling the sample program
 C:jdkbin>javac HelloWorld.java
 C:jdkbin>java HelloWorld
 Output
“ Hello World!”
Copyright : MCC ( Advanced Java
Programming) 12
JDK Tools
 Java Compiler, 'javac'
 Java Interpreter, 'java'
 Java Dissembler, 'javap'
 Documentation tool, 'javadoc'
 Java Debugger, 'jdb‘
 Applet viewer, 'appletviewer‘
Copyright : MCC ( Advanced Java
Programming) 13
Programming in Java
 Variables & Reserved Words
 Data types & Operators
 Control Structure
 Array Handling
 Classes & Methods
 String & Maths Classes
Copyright : MCC ( Advanced Java
Programming) 14
Primitive Types
 byte
 char
 boolean
 short
 int
 long
 float
 Double
Reference Types
Java Type
• long
• float
• Double
Copyright : MCC ( Advanced Java
Programming) 15
Operators
 Types of operators
– Arithmetic operators
– Bitwise operators
– Relational operators
– Logical operators
– Conditional operator
– Assignment operator
Copyright : MCC ( Advanced Java
Programming) 16
Arithmetic Operators
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
++ Increment
-- Decrement
Copyright : MCC ( Advanced Java
Programming) 17
Arithmetic Operators (Contd…)
+= Addition and assignment
-= Subtraction and assignment
*= Multiplication and assignment
/= Division and assignment
%= Modulus and assignment
Copyright : MCC ( Advanced Java
Programming) 18
Relational Operators
== Equal to
!= Not equal to
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
Copyright : MCC ( Advanced Java
Programming) 19
Logical Operators
 && Logical AND
 || Logical OR
 ! Logical unary NOT
Copyright : MCC ( Advanced Java
Programming) 20
Conditional Operator
Syntax
expression1 ? expression2 : expression3;
 expression1
Boolean condition that returns a True or False value
 Expression2
Value returned if expression1 evaluates to True
 expression3
Value returned if exp1 evaluates to False
Copyright : MCC ( Advanced Java
Programming) 21
Control Flow
 Decision-making
– if-else statement
– switch-case statement
 Loop
– while loop
– do-while loop
– for loop
Copyright : MCC ( Advanced Java
Programming) 22
Array Declarations
 Three ways for Array Declaration
– datatype identifier [ ];
– datatype identifier [ ] = new datatype[size];
– datatype identifier [ ]= {value1,value2,….valueN};
Copyright : MCC ( Advanced Java
Programming) 23
Methods in Classes
 A method is defined as the actual implementation of
an operation on an object
 Syntax
access_specifier modifier datatype method_name(parameter_list)
{
//body of method
}
Copyright : MCC ( Advanced Java
Programming) 24
Sample usage of Method
class Temp {
static int x = 10; // variable
public static void show( ) { // method
System.out.println(x);
}
public static void main(String args[ ]) {
Temp t = new Temp( ); // object 1
t.show( ); // method call
Temp t1 = new Temp( ); // object 2
t1.x = 20;
t1.show();
}}
Copyright : MCC ( Advanced Java
Programming) 25
String Class
 Constructor methods
– String str1 = new String();
– String str2 = new String(“Hello World”);
– char ch[ ] = {“A”,”B”,”C”,”D”,”E”};
– String str3 = new String(ch);
– String str4 = new String(ch,0,2);
Copyright : MCC ( Advanced Java
Programming) 26
String Class Methods
 charAt( )
 startsWith()
 endsWith( )
 copyValueOf( )
 toCharArray( )
• indexOf( )
• toUpperCase( )
• toLowerCase( )
• trim( )
• equals( )
Copyright : MCC ( Advanced Java
Programming) 27
java.lang.Math Class
 abs()
 ceil()
 floor()
 max()
 min()
 round()
 random()
 sqrt()
 sin()
 cos()
 tan()
Copyright : MCC ( Advanced Java
Programming) 28
Core Java API
 java.lang
 java.applet
 java.awt
 java.io
 java.util
• java.net
• java.awt.event
• java.rmi
• java.security
• java.sql
Copyright : MCC ( Advanced Java
Programming) 29
// Text string example
class Test_String
{
public static void main(String args[])
{
String name=" Hello Java Programming ";
char ch=name.charAt(6);
boolean flag1=name.startsWith("Hello");
boolean flag2=name.endsWith("Java");
char nname[]={'l','a','n','g','u','a','g','e'};
String subname=name.copyValueOf(nname,5,3);
int ind1=name.indexOf('J');
String up=name.toUpperCase();
String lo=name.toLowerCase();
String name2=name.trim();
System.out.println("charAt ttt " + ch);
System.out.println("Startswith java is t"+flag1);
System.out.println("Endswith java ist"+flag2);
System.out.println("copy value of t t"+subname);
System.out.println("Index of tt "+ind1);
System.out.println("To upper case t "+up);
System.out.println("To lower case t"+lo);
System.out.println("Trimming is t"+name2);
}
}
Copyright : MCC ( Advanced Java
Programming) 30
/*---Maths Classes---*/
public class math_methods{
public static void main(String[] args) {
final double PI=Math.PI;
final double E=Math.E;
System.out.println("E ="+E);
System.out.println("Math.exp(1.0) ="+Math.exp(1.0));
System.out.println("PI ="+PI);
System.out.println("4*Math.atan(1.0) ="+Math.atan(1.0));
System.out.println("Math.cos(2*PI) ="+Math.cos(2*PI));
System.out.println("Math.sin(PI/2) ="+Math.sin(PI/2));
System.out.println("Math.cos(PI/4) ="+Math.cos(PI/4));
System.out.println("Math.log(E) ="+Math.log(E));
System.out.println("Math.abs(-13.579) ="+Math.abs(-13.579));
System.out.println("Math.floor(13.579) ="+Math.floor(13.579));
System.out.println("Math.ceil(13.579) ="+Math.ceil(13.579));
System.out.println("Math.round(13.579) ="+Math.round(13.579));
System.out.println("Math.pow(25.0,0.5) ="+Math.pow(25.0,0.5));
System.out.println("Math.sqrt(25.0) ="+Math.sqrt(25.0));
System.out.println("Math.random() ="+Math.random());
System.out.println("Math.random() ="+(10*Math.random()));
}
}

More Related Content

What's hot

Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java LanguagePawanMM
 
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...Sagar Verma
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)arvind pandey
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh Samarthyam
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with javaHawkman Academy
 
Statics in java | Constructors | Exceptions in Java | String in java| class 3
Statics in java | Constructors | Exceptions in Java | String in java| class 3Statics in java | Constructors | Exceptions in Java | String in java| class 3
Statics in java | Constructors | Exceptions in Java | String in java| class 3Sagar Verma
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+javaYe Win
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java ProgrammingMath-Circle
 
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia "What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia Vladimir Ivanov
 
Core java concepts
Core java  conceptsCore java  concepts
Core java conceptsRam132
 
OOP with Java - Continued
OOP with Java - Continued OOP with Java - Continued
OOP with Java - Continued Hitesh-Java
 
Core Java Certification
Core Java CertificationCore Java Certification
Core Java CertificationVskills
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Javabackdoor
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Abdul Hannan
 

What's hot (20)

Java Programming
Java ProgrammingJava Programming
Java Programming
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
 
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Java Reflection
Java ReflectionJava Reflection
Java Reflection
 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with java
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Statics in java | Constructors | Exceptions in Java | String in java| class 3
Statics in java | Constructors | Exceptions in Java | String in java| class 3Statics in java | Constructors | Exceptions in Java | String in java| class 3
Statics in java | Constructors | Exceptions in Java | String in java| class 3
 
Basics of Java
Basics of JavaBasics of Java
Basics of Java
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+java
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia "What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
 
OOP with Java - Continued
OOP with Java - Continued OOP with Java - Continued
OOP with Java - Continued
 
Core Java Certification
Core Java CertificationCore Java Certification
Core Java Certification
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual
 

Viewers also liked

Double linked list
Double linked listDouble linked list
Double linked listraviahuja11
 
Dlspowerpoint
DlspowerpointDlspowerpoint
Dlspowerpointlhumes7
 
Basdat
BasdatBasdat
Basdatvely
 
Barack obama visit to india
Barack obama visit to indiaBarack obama visit to india
Barack obama visit to indiajatinkhurana
 
My first Maemo desktop widget
My first Maemo desktop widgetMy first Maemo desktop widget
My first Maemo desktop widgetmarcoil
 
Setting up a Bilingual Approach to Teaching
Setting up a Bilingual Approach to TeachingSetting up a Bilingual Approach to Teaching
Setting up a Bilingual Approach to TeachingAvueltas Conele
 
Emily Farrell's Scavenger Hunt
Emily Farrell's Scavenger HuntEmily Farrell's Scavenger Hunt
Emily Farrell's Scavenger Huntguest4bff1d20
 
Learning Spanish at St. Paul's
Learning Spanish at St. Paul'sLearning Spanish at St. Paul's
Learning Spanish at St. Paul'sAvueltas Conele
 
Ge6161 lab manual
Ge6161 lab manualGe6161 lab manual
Ge6161 lab manualMani Kandan
 
Successful Bilingual Programmes
Successful Bilingual Programmes Successful Bilingual Programmes
Successful Bilingual Programmes Avueltas Conele
 
Data structure
Data structureData structure
Data structureMohd Arif
 
Humanities scholars information-seeking
Humanities scholars information-seekingHumanities scholars information-seeking
Humanities scholars information-seekinglhumes7
 
Urban Project Fall2009
Urban Project Fall2009Urban Project Fall2009
Urban Project Fall2009adsiegel
 

Viewers also liked (20)

Double linked list
Double linked listDouble linked list
Double linked list
 
Dlspowerpoint
DlspowerpointDlspowerpoint
Dlspowerpoint
 
Basdat
BasdatBasdat
Basdat
 
Poetry Slam for Poverty
Poetry Slam for PovertyPoetry Slam for Poverty
Poetry Slam for Poverty
 
Barack obama visit to india
Barack obama visit to indiaBarack obama visit to india
Barack obama visit to india
 
Vida Cotidiana.
Vida Cotidiana.Vida Cotidiana.
Vida Cotidiana.
 
My first Maemo desktop widget
My first Maemo desktop widgetMy first Maemo desktop widget
My first Maemo desktop widget
 
Los Colores.
Los Colores.Los Colores.
Los Colores.
 
Max Schmidt NMDL Presentation
Max Schmidt NMDL PresentationMax Schmidt NMDL Presentation
Max Schmidt NMDL Presentation
 
El Tiempo Atmosférico.
El Tiempo Atmosférico.El Tiempo Atmosférico.
El Tiempo Atmosférico.
 
Setting up a Bilingual Approach to Teaching
Setting up a Bilingual Approach to TeachingSetting up a Bilingual Approach to Teaching
Setting up a Bilingual Approach to Teaching
 
Mi vida
Mi vidaMi vida
Mi vida
 
Emily Farrell's Scavenger Hunt
Emily Farrell's Scavenger HuntEmily Farrell's Scavenger Hunt
Emily Farrell's Scavenger Hunt
 
String operation
String operationString operation
String operation
 
Learning Spanish at St. Paul's
Learning Spanish at St. Paul'sLearning Spanish at St. Paul's
Learning Spanish at St. Paul's
 
Ge6161 lab manual
Ge6161 lab manualGe6161 lab manual
Ge6161 lab manual
 
Successful Bilingual Programmes
Successful Bilingual Programmes Successful Bilingual Programmes
Successful Bilingual Programmes
 
Data structure
Data structureData structure
Data structure
 
Humanities scholars information-seeking
Humanities scholars information-seekingHumanities scholars information-seeking
Humanities scholars information-seeking
 
Urban Project Fall2009
Urban Project Fall2009Urban Project Fall2009
Urban Project Fall2009
 

Similar to Java

4CS4-25-Java-Lab-Manual.pdf
4CS4-25-Java-Lab-Manual.pdf4CS4-25-Java-Lab-Manual.pdf
4CS4-25-Java-Lab-Manual.pdfamitbhachne
 
IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016Trayan Iliev
 
Java Intro
Java IntroJava Intro
Java Introbackdoor
 
Unit No. 1 Introduction to Java.pptx
Unit No. 1 Introduction to Java.pptxUnit No. 1 Introduction to Java.pptx
Unit No. 1 Introduction to Java.pptxDrYogeshDeshmukh1
 
It pro dev_birbilis_20101127_en
It pro dev_birbilis_20101127_enIt pro dev_birbilis_20101127_en
It pro dev_birbilis_20101127_enGeorge Birbilis
 
Topic2JavaBasics.ppt
Topic2JavaBasics.pptTopic2JavaBasics.ppt
Topic2JavaBasics.pptMENACE4
 
hallleuah_java.ppt
hallleuah_java.ppthallleuah_java.ppt
hallleuah_java.pptRahul201258
 
I/O (imput/output) [JAVA]
I/O  (imput/output) [JAVA]I/O  (imput/output) [JAVA]
I/O (imput/output) [JAVA]Hack '
 
SE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUSSE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUSnikshaikh786
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topicsRajesh Verma
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profilerIhor Bobak
 
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
Deep learning and streaming in Apache Spark 2.2 by Matei ZahariaDeep learning and streaming in Apache Spark 2.2 by Matei Zaharia
Deep learning and streaming in Apache Spark 2.2 by Matei ZahariaGoDataDriven
 
What's New in Java 8
What's New in Java 8What's New in Java 8
What's New in Java 8javafxpert
 
Java programming concept
Java programming conceptJava programming concept
Java programming conceptSanjay Gunjal
 
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Soumen Santra
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)Netcetera
 

Similar to Java (20)

4CS4-25-Java-Lab-Manual.pdf
4CS4-25-Java-Lab-Manual.pdf4CS4-25-Java-Lab-Manual.pdf
4CS4-25-Java-Lab-Manual.pdf
 
IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016
 
Java Intro
Java IntroJava Intro
Java Intro
 
Unit No. 1 Introduction to Java.pptx
Unit No. 1 Introduction to Java.pptxUnit No. 1 Introduction to Java.pptx
Unit No. 1 Introduction to Java.pptx
 
It pro dev_birbilis_20101127_en
It pro dev_birbilis_20101127_enIt pro dev_birbilis_20101127_en
It pro dev_birbilis_20101127_en
 
Topic2JavaBasics.ppt
Topic2JavaBasics.pptTopic2JavaBasics.ppt
Topic2JavaBasics.ppt
 
hallleuah_java.ppt
hallleuah_java.ppthallleuah_java.ppt
hallleuah_java.ppt
 
2.ppt
2.ppt2.ppt
2.ppt
 
I/O (imput/output) [JAVA]
I/O  (imput/output) [JAVA]I/O  (imput/output) [JAVA]
I/O (imput/output) [JAVA]
 
SE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUSSE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUS
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topics
 
Naver_alternative_to_jpa
Naver_alternative_to_jpaNaver_alternative_to_jpa
Naver_alternative_to_jpa
 
JavaSecure
JavaSecureJavaSecure
JavaSecure
 
Complete java
Complete javaComplete java
Complete java
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
Deep learning and streaming in Apache Spark 2.2 by Matei ZahariaDeep learning and streaming in Apache Spark 2.2 by Matei Zaharia
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
 
What's New in Java 8
What's New in Java 8What's New in Java 8
What's New in Java 8
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
 

Recently uploaded

Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxCynthia Clay
 
Progress Report - Oracle's OCI Analyst Summit 2024
Progress Report - Oracle's OCI Analyst Summit 2024Progress Report - Oracle's OCI Analyst Summit 2024
Progress Report - Oracle's OCI Analyst Summit 2024Holger Mueller
 
Ital Liptz - all about Itai Liptz. news.
Ital Liptz - all about Itai Liptz. news.Ital Liptz - all about Itai Liptz. news.
Ital Liptz - all about Itai Liptz. news.htj82vpw
 
Jual obat aborsi Hongkong ( 085657271886 ) Cytote pil telat bulan penggugur k...
Jual obat aborsi Hongkong ( 085657271886 ) Cytote pil telat bulan penggugur k...Jual obat aborsi Hongkong ( 085657271886 ) Cytote pil telat bulan penggugur k...
Jual obat aborsi Hongkong ( 085657271886 ) Cytote pil telat bulan penggugur k...Klinik kandungan
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxDitasDelaCruz
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon investment
 
GURGAON CALL GIRL ❤ 8272964427❤ CALL GIRLS IN GURGAON ESCORTS SERVICE PROVIDE
GURGAON CALL GIRL ❤ 8272964427❤ CALL GIRLS IN GURGAON  ESCORTS SERVICE PROVIDEGURGAON CALL GIRL ❤ 8272964427❤ CALL GIRLS IN GURGAON  ESCORTS SERVICE PROVIDE
GURGAON CALL GIRL ❤ 8272964427❤ CALL GIRLS IN GURGAON ESCORTS SERVICE PROVIDEkajalroy875762
 
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...ssuserf63bd7
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Adnet Communications
 
obat aborsi bandung wa 081336238223 jual obat aborsi cytotec asli di bandung9...
obat aborsi bandung wa 081336238223 jual obat aborsi cytotec asli di bandung9...obat aborsi bandung wa 081336238223 jual obat aborsi cytotec asli di bandung9...
obat aborsi bandung wa 081336238223 jual obat aborsi cytotec asli di bandung9...yulianti213969
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 MonthsIndeedSEO
 
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...ssuserf63bd7
 
A DAY IN THE LIFE OF A SALESPERSON .pptx
A DAY IN THE LIFE OF A SALESPERSON .pptxA DAY IN THE LIFE OF A SALESPERSON .pptx
A DAY IN THE LIFE OF A SALESPERSON .pptxseemajojo02
 
2024 May - Clearbit Integration with Hubspot - Greenville HUG.pptx
2024 May - Clearbit Integration with Hubspot  - Greenville HUG.pptx2024 May - Clearbit Integration with Hubspot  - Greenville HUG.pptx
2024 May - Clearbit Integration with Hubspot - Greenville HUG.pptxBoundify
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon investment
 
Pre Engineered Building Manufacturers Hyderabad.pptx
Pre Engineered  Building Manufacturers Hyderabad.pptxPre Engineered  Building Manufacturers Hyderabad.pptx
Pre Engineered Building Manufacturers Hyderabad.pptxRoofing Contractor
 
The Art of Decision-Making: Navigating Complexity and Uncertainty
The Art of Decision-Making: Navigating Complexity and UncertaintyThe Art of Decision-Making: Navigating Complexity and Uncertainty
The Art of Decision-Making: Navigating Complexity and Uncertaintycapivisgroup
 

Recently uploaded (20)

Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptx
 
Progress Report - Oracle's OCI Analyst Summit 2024
Progress Report - Oracle's OCI Analyst Summit 2024Progress Report - Oracle's OCI Analyst Summit 2024
Progress Report - Oracle's OCI Analyst Summit 2024
 
Ital Liptz - all about Itai Liptz. news.
Ital Liptz - all about Itai Liptz. news.Ital Liptz - all about Itai Liptz. news.
Ital Liptz - all about Itai Liptz. news.
 
Contact +971581248768 for 100% original and safe abortion pills available for...
Contact +971581248768 for 100% original and safe abortion pills available for...Contact +971581248768 for 100% original and safe abortion pills available for...
Contact +971581248768 for 100% original and safe abortion pills available for...
 
Jual obat aborsi Hongkong ( 085657271886 ) Cytote pil telat bulan penggugur k...
Jual obat aborsi Hongkong ( 085657271886 ) Cytote pil telat bulan penggugur k...Jual obat aborsi Hongkong ( 085657271886 ) Cytote pil telat bulan penggugur k...
Jual obat aborsi Hongkong ( 085657271886 ) Cytote pil telat bulan penggugur k...
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
 
Buy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail AccountsBuy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail Accounts
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
 
GURGAON CALL GIRL ❤ 8272964427❤ CALL GIRLS IN GURGAON ESCORTS SERVICE PROVIDE
GURGAON CALL GIRL ❤ 8272964427❤ CALL GIRLS IN GURGAON  ESCORTS SERVICE PROVIDEGURGAON CALL GIRL ❤ 8272964427❤ CALL GIRLS IN GURGAON  ESCORTS SERVICE PROVIDE
GURGAON CALL GIRL ❤ 8272964427❤ CALL GIRLS IN GURGAON ESCORTS SERVICE PROVIDE
 
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
 
obat aborsi bandung wa 081336238223 jual obat aborsi cytotec asli di bandung9...
obat aborsi bandung wa 081336238223 jual obat aborsi cytotec asli di bandung9...obat aborsi bandung wa 081336238223 jual obat aborsi cytotec asli di bandung9...
obat aborsi bandung wa 081336238223 jual obat aborsi cytotec asli di bandung9...
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
 
A DAY IN THE LIFE OF A SALESPERSON .pptx
A DAY IN THE LIFE OF A SALESPERSON .pptxA DAY IN THE LIFE OF A SALESPERSON .pptx
A DAY IN THE LIFE OF A SALESPERSON .pptx
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
2024 May - Clearbit Integration with Hubspot - Greenville HUG.pptx
2024 May - Clearbit Integration with Hubspot  - Greenville HUG.pptx2024 May - Clearbit Integration with Hubspot  - Greenville HUG.pptx
2024 May - Clearbit Integration with Hubspot - Greenville HUG.pptx
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
Pre Engineered Building Manufacturers Hyderabad.pptx
Pre Engineered  Building Manufacturers Hyderabad.pptxPre Engineered  Building Manufacturers Hyderabad.pptx
Pre Engineered Building Manufacturers Hyderabad.pptx
 
The Art of Decision-Making: Navigating Complexity and Uncertainty
The Art of Decision-Making: Navigating Complexity and UncertaintyThe Art of Decision-Making: Navigating Complexity and Uncertainty
The Art of Decision-Making: Navigating Complexity and Uncertainty
 

Java

  • 1. U Nyein OoU Nyein Oo Director/COO(IT)Director/COO(IT) Myanma Computer Co., LtdMyanma Computer Co., Ltd IADCS Diploma CourseIADCS Diploma Course Advanced Java
  • 2. Copyright : MCC ( Advanced Java Programming) 2 Subject Content 1. Introduction to Java & OOP 2. Programming in Java 3. Types- Primitive, Reference and Garbage Collection 4. Classes and Packages with OO Programming 5. Exception Handling with Java 6. Object Cloning and RTTI 7. Programming I/O within Java
  • 3. Copyright : MCC ( Advanced Java Programming) 3 Subject Content (cont) 8. Object & Classes in Java 9. Multithreading 10. Introduction to GUI 11. Programming Windows and Events 12. Client side Java, Applets and JavaBeans 13. Network Programming with Java 14. Programming Server-side Java
  • 4. Copyright : MCC ( Advanced Java Programming) 4 • Inline sound that play in real time whenever a user loads a page • Music that plays in the background on a page • Cartoon Style Animations • Real time Video • Multiplayer interactive games Application of Java
  • 5. Copyright : MCC ( Advanced Java Programming) 5 Introduction to Java  - Object Oriented Programming - Developed by Sun Microsystems - At USA in 1991 by James Gosling.  Originally called Oak - Platform Independent Language.  Internet Programming Language.
  • 6. Copyright : MCC ( Advanced Java Programming) 6 Features of Java  Simple  Object-oriented  Platform-independent  Robust  Safe (Secure)  High Performance  Multithreaded  Distributed  Dynamic
  • 7. Copyright : MCC ( Advanced Java Programming) 7 Types of Java Programs •Applications •Command Line •GUI •Applets •Servlets •Packages •Database Applications
  • 8. Copyright : MCC ( Advanced Java Programming) 8 Command Line Application // Sample Java Program class HelloWorld{ public static void main(String args[]) { System.out.println(“Helloworld ”); } }
  • 9. Copyright : MCC ( Advanced Java Programming) 9 Compilation code in Java
  • 10. Copyright : MCC ( Advanced Java Programming) 10 Traditional way of compilation
  • 11. Copyright : MCC ( Advanced Java Programming) 11 Compiling the sample program  C:jdkbin>javac HelloWorld.java  C:jdkbin>java HelloWorld  Output “ Hello World!”
  • 12. Copyright : MCC ( Advanced Java Programming) 12 JDK Tools  Java Compiler, 'javac'  Java Interpreter, 'java'  Java Dissembler, 'javap'  Documentation tool, 'javadoc'  Java Debugger, 'jdb‘  Applet viewer, 'appletviewer‘
  • 13. Copyright : MCC ( Advanced Java Programming) 13 Programming in Java  Variables & Reserved Words  Data types & Operators  Control Structure  Array Handling  Classes & Methods  String & Maths Classes
  • 14. Copyright : MCC ( Advanced Java Programming) 14 Primitive Types  byte  char  boolean  short  int  long  float  Double Reference Types Java Type • long • float • Double
  • 15. Copyright : MCC ( Advanced Java Programming) 15 Operators  Types of operators – Arithmetic operators – Bitwise operators – Relational operators – Logical operators – Conditional operator – Assignment operator
  • 16. Copyright : MCC ( Advanced Java Programming) 16 Arithmetic Operators + Addition - Subtraction * Multiplication / Division % Modulus ++ Increment -- Decrement
  • 17. Copyright : MCC ( Advanced Java Programming) 17 Arithmetic Operators (Contd…) += Addition and assignment -= Subtraction and assignment *= Multiplication and assignment /= Division and assignment %= Modulus and assignment
  • 18. Copyright : MCC ( Advanced Java Programming) 18 Relational Operators == Equal to != Not equal to < Less than > Greater than <= Less than or equal to >= Greater than or equal to
  • 19. Copyright : MCC ( Advanced Java Programming) 19 Logical Operators  && Logical AND  || Logical OR  ! Logical unary NOT
  • 20. Copyright : MCC ( Advanced Java Programming) 20 Conditional Operator Syntax expression1 ? expression2 : expression3;  expression1 Boolean condition that returns a True or False value  Expression2 Value returned if expression1 evaluates to True  expression3 Value returned if exp1 evaluates to False
  • 21. Copyright : MCC ( Advanced Java Programming) 21 Control Flow  Decision-making – if-else statement – switch-case statement  Loop – while loop – do-while loop – for loop
  • 22. Copyright : MCC ( Advanced Java Programming) 22 Array Declarations  Three ways for Array Declaration – datatype identifier [ ]; – datatype identifier [ ] = new datatype[size]; – datatype identifier [ ]= {value1,value2,….valueN};
  • 23. Copyright : MCC ( Advanced Java Programming) 23 Methods in Classes  A method is defined as the actual implementation of an operation on an object  Syntax access_specifier modifier datatype method_name(parameter_list) { //body of method }
  • 24. Copyright : MCC ( Advanced Java Programming) 24 Sample usage of Method class Temp { static int x = 10; // variable public static void show( ) { // method System.out.println(x); } public static void main(String args[ ]) { Temp t = new Temp( ); // object 1 t.show( ); // method call Temp t1 = new Temp( ); // object 2 t1.x = 20; t1.show(); }}
  • 25. Copyright : MCC ( Advanced Java Programming) 25 String Class  Constructor methods – String str1 = new String(); – String str2 = new String(“Hello World”); – char ch[ ] = {“A”,”B”,”C”,”D”,”E”}; – String str3 = new String(ch); – String str4 = new String(ch,0,2);
  • 26. Copyright : MCC ( Advanced Java Programming) 26 String Class Methods  charAt( )  startsWith()  endsWith( )  copyValueOf( )  toCharArray( ) • indexOf( ) • toUpperCase( ) • toLowerCase( ) • trim( ) • equals( )
  • 27. Copyright : MCC ( Advanced Java Programming) 27 java.lang.Math Class  abs()  ceil()  floor()  max()  min()  round()  random()  sqrt()  sin()  cos()  tan()
  • 28. Copyright : MCC ( Advanced Java Programming) 28 Core Java API  java.lang  java.applet  java.awt  java.io  java.util • java.net • java.awt.event • java.rmi • java.security • java.sql
  • 29. Copyright : MCC ( Advanced Java Programming) 29 // Text string example class Test_String { public static void main(String args[]) { String name=" Hello Java Programming "; char ch=name.charAt(6); boolean flag1=name.startsWith("Hello"); boolean flag2=name.endsWith("Java"); char nname[]={'l','a','n','g','u','a','g','e'}; String subname=name.copyValueOf(nname,5,3); int ind1=name.indexOf('J'); String up=name.toUpperCase(); String lo=name.toLowerCase(); String name2=name.trim(); System.out.println("charAt ttt " + ch); System.out.println("Startswith java is t"+flag1); System.out.println("Endswith java ist"+flag2); System.out.println("copy value of t t"+subname); System.out.println("Index of tt "+ind1); System.out.println("To upper case t "+up); System.out.println("To lower case t"+lo); System.out.println("Trimming is t"+name2); } }
  • 30. Copyright : MCC ( Advanced Java Programming) 30 /*---Maths Classes---*/ public class math_methods{ public static void main(String[] args) { final double PI=Math.PI; final double E=Math.E; System.out.println("E ="+E); System.out.println("Math.exp(1.0) ="+Math.exp(1.0)); System.out.println("PI ="+PI); System.out.println("4*Math.atan(1.0) ="+Math.atan(1.0)); System.out.println("Math.cos(2*PI) ="+Math.cos(2*PI)); System.out.println("Math.sin(PI/2) ="+Math.sin(PI/2)); System.out.println("Math.cos(PI/4) ="+Math.cos(PI/4)); System.out.println("Math.log(E) ="+Math.log(E)); System.out.println("Math.abs(-13.579) ="+Math.abs(-13.579)); System.out.println("Math.floor(13.579) ="+Math.floor(13.579)); System.out.println("Math.ceil(13.579) ="+Math.ceil(13.579)); System.out.println("Math.round(13.579) ="+Math.round(13.579)); System.out.println("Math.pow(25.0,0.5) ="+Math.pow(25.0,0.5)); System.out.println("Math.sqrt(25.0) ="+Math.sqrt(25.0)); System.out.println("Math.random() ="+Math.random()); System.out.println("Math.random() ="+(10*Math.random())); } }