SlideShare uma empresa Scribd logo
1 de 37
Name : Muhammad Asif Subhani
Email: asif.subhani@umt.edu.pk
Course Structure:

Lectures: 2








Attendance as per university policy.
However, if you do decide to join, you are not
allowed to leave the class before its completion
without the permission of the instructor
Drink food not allowed in class
Use of cell phones and similar devices is not
permissible during the class. Your phones should
not be visible or heard during the class
Automated tools to check for plagiarism
Quizzes (10%)
Assignments (15%)
Mid Term Exam (15%)
Project (30%)
Final Exam (30%)








10-15 minutes duration
Will cover assignments and material covered
in the class
Unannounced
No make-ups
We will be dropping some quizzes from the
final grade









Assignments are individual or may be in
group.
No late submissions
I encourage you to discuss your assignments
with your friends but no copying is allowed.
Both the copier and the originator will get 0.
20% marks deduction on per day late
submission.
100% Deduction on no submission.




MIDTERM:A single midterm exam that will
cover all material covered till the midterm.
FINAL: Will cover the entire course. The final
will contain tough programming tasks





Project will be in group and the submission of
project in deliverables.
No late submission of project deliverables.
Project deadline and other detail will be
announced later.














Introduction to Java
Basic I/O concepts, String, Wrapper Classes, Collections, Streams
OOP Concepts – Encapsulation, Inheritance, Polymorphism
OOP in Java – Inheritance, Abstract superclasses, Interfaces, Inner classes,
Packages.
Exception Handling
Building GUIs with Swing. Components, drawing, layouts, graphics
Events and Event Handling
Threads and concurrency- Threads, synchronization
JDBC – Database Application
Networking – Client Server Application
Using 3rd party API









Agile Development
Project Management & Documentation
Testing
UML Diagrams
Code Refactoring ,Design Pattern
Version Control System
Project Demos / Presentation






Java as a second language course
◦ Teaches programming in Java for people who already know how to
program in C or similar language
The Java programming language is a high-level language that can be
characterized by all of the following buzzwords:
◦ Simple
◦ Object oriented
◦ Distributed
◦ Multithreaded
◦ Dynamic
◦ Architecture neutral
◦ Portable
◦ High performance
◦ Robust
◦ Secure
Pre-requisites
◦ Basic programming background (C/C++)
◦ Problem solving techniques
◦ Debugging skills



The Java Language runs on a “Java Virtual Machine”
The Java compiler (javac) compiles Java code into
byte-code




Java Development Kit (JDK) is an implementation of either
one of the Java SE, Java EE or Java ME platforms released
by Oracle Corporation
The Java platform has two components:
◦ The Java Virtual Machine
◦ The Java Application Programming Interface (API)









Development Tools: compiling(javac compiler), running, monitoring,
debugging, and documenting (javadoc documentation )your
applications.
Application Programming Interface (API): The API provides the core
functionality of the Java programming language.. It spans everything
from basic objects, to networking and security, to XML generation
and database access, and more.
Deployment Technologies: Java Web Start software and Java Plug-In.
User Interface Toolkits: The Swing and Java 2D toolkits.
Integration Libraries: JDBC™ API, Java RMI
.java

.jar/
.class

.c/
.cpp

Compiler

JDK

.jar/
.class

Computer

JVM

Editor

1
0
1
0
1

101111101010
1

Computer

.obj

.exe

1
0
1
0
1

Computer


Core language
◦ Ints, array, objects, loops and conditionals



Libraries
◦ This is where the power of Java really emerges
 String, ArrayList, HashMap, String Tokenizer

◦ Networking, Graphics, Database connectivity,
◦ Re-use at it’s best (so far).



Similar to C/C++ in syntax
But eliminates several complexities of
◦
◦
◦
◦
◦





No operator overloading
No direct pointer manipulation or pointer arithmetic
No multiple inheritance
No malloc() and free() – handles memory automatically
Garbage Collector

Lots more things which make Java more
attractive.
Avoid platform dependencies. Write once, run
anywhere.
http://www.oracle.com/technetwork/java/java
se/downloads/index.html
1

2

3
C:>set path="c:programfilesJavajdk1.7.0_17bin"
C:>set classpath=%classpath%;.;
Your first application, HelloWorldApp, will simply display the
greeting "Hello world!". To create this program, you will:






Create a source file
A source file contains code, written in the Java programming
language, that you and other programmers can understand. You
can use any text editor to create and edit source files.
Compile the source file into a .class file
The Java programming language compiler (javac) takes your
source file and translates its text into instructions that the Java
virtual machine can understand. The instructions contained
within this file are known as bytecodes.
Run the program
The Java application launcher tool (java) uses the Java virtual
machine to run your application.
class HelloWorldApp {
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}












Save the code in a file with the name HelloWorldApp.java. To do this in Notepad, first
choose the File > Save As menu item. Then, in the Save As dialog box:
Using the Save in combo box, specify the folder (directory) where you'll save your file. In
this example, the directory is java on the C drive.
In the File name text field, type "HelloWorldApp.java", including the quotation marks.
From the Save as type combo box, choose Text Documents (*.txt).
In the Encoding combo box, leave the encoding as ANSI.
When you're finished, the dialog box should look like this.

The Save As dialog just before you click Save.
Now click Save, and exit Notepad.
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7netbeans-download-432126.html








Your first application, HelloWorldApp, will simply display the greeting "Hello
World!" To create this program, you will:
Create an IDE project
When you create an IDE project, you create an environment in which to build and
run your applications. Using IDE projects eliminates configuration issues normally
associated with developing on the command line. You can build or run your
application by choosing a single menu item within the IDE.
Add code to the generated source file
A source file contains code, written in the Java programming language, that you
and other programmers can understand. As part of creating an IDE project, a
skeleton source file will be automatically generated. You will then modify the
source file to add the "Hello World!" message.
Compile the source file into a .class file
The IDE invokes the Java programming language compiler (javac), which takes your
source file and translates its text into instructions that the Java virtual machine can
understand. The instructions contained within this file are known as bytecodes.
Run the program
The IDE invokes the Java application launcher tool (java), which uses the Java
virtual machine to run your application.
To create an IDE project:
1.Launch the NetBeans IDE.
◦ On Microsoft Windows systems, you can use the NetBeans IDE
item in the Start menu.

2.In the NetBeans IDE, choose File | New Project.
3.In the New Project wizard, expand the Java category and
select Java Application as shown in the following figure:
4.In the Name and Location page of the wizard, do the following (as shown in the figure
below):

In the Project Name field, type Hello World App.

In the Create Main Class field, type helloworldapp.HelloWorldApp.

Leave the Set as Main Project checkbox selected.
5.Click Finish.
The project is created and opened in the IDE. You should see the following components:

The Projects window, which contains a tree view of the components of the project,
including source files, libraries that your code depends on, and so on.

The Source Editor window with a file called HelloWorldApp open.

The Navigator window, which you can use to quickly navigate between elements within
the selected class.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package helloworldapp;
/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
public class HelloWorldApp {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}
6.To compile your source file, choose Run | Build Main Project from the IDE's main menu.
7.From the IDE's menu bar, choose Run | Run Main Project.










Comments are ignored by the compiler but are useful to
other programmers. The Java programming language
supports three kinds of comments:
/* text */
The compiler ignores everything from /* to */.
/** documentation */
This indicates a documentation comment (doc comment,
for short). The compiler ignores this kind of comment, just
like it ignores comments that use /* and */. The javadoc
tool uses doc comments when preparing automatically
generated documentation. For more information on
javadoc, see the Javadoc™ tool documentation .
// text
The compiler ignores everything from // to the end of the
line.






In the Java programming language, every
application must contain a main method whose
signature is:
public static void main(String[] args)
The modifiers public and static can be written in
either order (public static or static public), but
the convention is to use public static as shown
above. You can name the argument anything you
want, but most programmers choose "args" or
"argv".
The main method is similar to the main function
in C and C++; it's the entry point for your
application and will subsequently invoke all the
other methods required by your program.










The main method accepts a single argument: an array of
elements of type String.
public static void main(String[] args)
This array is the mechanism through which the runtime system
passes information to your application. For example:
java MyApp arg1 arg2
Each string in the array is called a command-line argument.
Command-line arguments let users affect the operation of the
application without recompiling it.
For example, a sorting program might allow the user to specify
that the data be sorted in descending order with this commandline argument:
-descending
The "Hello World!" application ignores its command-line
arguments, but you should be aware of the fact that such
arguments do exist.

Mais conteúdo relacionado

Mais procurados

Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objectsvmadan89
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Java Lover
 
Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Sahil Gupta
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Pratima Parida
 
Chapter 1 introduction to java technology
Chapter 1 introduction to java technologyChapter 1 introduction to java technology
Chapter 1 introduction to java technologysshhzap
 
Introducción a la progrogramación orientada a objetos con Java
Introducción a la progrogramación orientada a objetos con JavaIntroducción a la progrogramación orientada a objetos con Java
Introducción a la progrogramación orientada a objetos con JavaFacultad de Ciencias y Sistemas
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unitgowher172236
 
01. Introduction to Programming
01. Introduction to Programming01. Introduction to Programming
01. Introduction to ProgrammingIntro C# Book
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology dM Technologies
 
Installing JDK and first java program
Installing JDK and first java programInstalling JDK and first java program
Installing JDK and first java programsunmitraeducation
 

Mais procurados (19)

JAVA Program Examples
JAVA Program ExamplesJAVA Program Examples
JAVA Program Examples
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
Java intro
Java introJava intro
Java intro
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
Chapter 1 introduction to java technology
Chapter 1 introduction to java technologyChapter 1 introduction to java technology
Chapter 1 introduction to java technology
 
Java notes
Java notesJava notes
Java notes
 
JAVA First Day
JAVA First DayJAVA First Day
JAVA First Day
 
Introducción a la progrogramación orientada a objetos con Java
Introducción a la progrogramación orientada a objetos con JavaIntroducción a la progrogramación orientada a objetos con Java
Introducción a la progrogramación orientada a objetos con Java
 
Java Notes
Java Notes Java Notes
Java Notes
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unit
 
Java essential notes
Java essential notesJava essential notes
Java essential notes
 
01. Introduction to Programming
01. Introduction to Programming01. Introduction to Programming
01. Introduction to Programming
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
Programming in Java
Programming in JavaProgramming in Java
Programming in Java
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology
 
Installing JDK and first java program
Installing JDK and first java programInstalling JDK and first java program
Installing JDK and first java program
 
Introduction to java technology
Introduction to java technologyIntroduction to java technology
Introduction to java technology
 

Destaque

Introduction to java
Introduction to javaIntroduction to java
Introduction to javaASU Online
 
Military Police Host Nation Policing Simulation: A Case Study into Designing ...
Military Police Host Nation Policing Simulation: A Case Study into Designing ...Military Police Host Nation Policing Simulation: A Case Study into Designing ...
Military Police Host Nation Policing Simulation: A Case Study into Designing ...Ronald Punako, Jr.
 
Introduction to basics of java
Introduction to basics of javaIntroduction to basics of java
Introduction to basics of javavinay arora
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of JavaFu Cheng
 
Basic of Java Netbeans
Basic of Java NetbeansBasic of Java Netbeans
Basic of Java NetbeansShrey Goswami
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Javayzebelle
 

Destaque (15)

Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Military Police Host Nation Policing Simulation: A Case Study into Designing ...
Military Police Host Nation Policing Simulation: A Case Study into Designing ...Military Police Host Nation Policing Simulation: A Case Study into Designing ...
Military Police Host Nation Policing Simulation: A Case Study into Designing ...
 
Introduction to basics of java
Introduction to basics of javaIntroduction to basics of java
Introduction to basics of java
 
History of java
History of javaHistory of java
History of java
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Basic of Java Netbeans
Basic of Java NetbeansBasic of Java Netbeans
Basic of Java Netbeans
 
Ppt on java basics1
Ppt on java basics1Ppt on java basics1
Ppt on java basics1
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
about java
about javaabout java
about java
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Evolution of java By Abbas khan
Evolution of java   By Abbas khan Evolution of java   By Abbas khan
Evolution of java By Abbas khan
 
Java tutorial
Java tutorialJava tutorial
Java tutorial
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java programming course for beginners
Java programming course for beginnersJava programming course for beginners
Java programming course for beginners
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 

Semelhante a Introduction to java

Java lab1 manual
Java lab1 manualJava lab1 manual
Java lab1 manualnahalomar
 
1 2 java development
1 2 java development1 2 java development
1 2 java developmentKen Kretsch
 
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 developmentKen Kretsch
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software DevelopmentZeeshan MIrza
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Pratima Parida
 
java 1 new.pdf
java 1 new.pdfjava 1 new.pdf
java 1 new.pdfSulSya
 
OOPM Introduction.ppt
OOPM Introduction.pptOOPM Introduction.ppt
OOPM Introduction.pptvijay251387
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdfAdiseshaK
 
(Ebook pdf) java programming language basics
(Ebook pdf)   java programming language basics(Ebook pdf)   java programming language basics
(Ebook pdf) java programming language basicsRaffaella D'angelo
 
Chapter 1.3
Chapter 1.3Chapter 1.3
Chapter 1.3sotlsoc
 
Java basics notes
Java basics notesJava basics notes
Java basics notesNexus
 

Semelhante a Introduction to java (20)

Java lab1 manual
Java lab1 manualJava lab1 manual
Java lab1 manual
 
1 2 java development
1 2 java development1 2 java development
1 2 java development
 
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
 
Javalecture 1
Javalecture 1Javalecture 1
Javalecture 1
 
Java introduction
Java introductionJava introduction
Java introduction
 
Curso de Programación Java Básico
Curso de Programación Java BásicoCurso de Programación Java Básico
Curso de Programación Java Básico
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
 
Core java introduction
Core java introduction Core java introduction
Core java introduction
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
java 1 new.pdf
java 1 new.pdfjava 1 new.pdf
java 1 new.pdf
 
Java programming language basics
Java programming language basicsJava programming language basics
Java programming language basics
 
OOPM Introduction.ppt
OOPM Introduction.pptOOPM Introduction.ppt
OOPM Introduction.ppt
 
J introtojava1-pdf
J introtojava1-pdfJ introtojava1-pdf
J introtojava1-pdf
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdf
 
(Ebook pdf) java programming language basics
(Ebook pdf)   java programming language basics(Ebook pdf)   java programming language basics
(Ebook pdf) java programming language basics
 
Chapter 1.3
Chapter 1.3Chapter 1.3
Chapter 1.3
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Java programming basics notes for beginners(java programming tutorials)
Java programming basics notes for beginners(java programming tutorials)Java programming basics notes for beginners(java programming tutorials)
Java programming basics notes for beginners(java programming tutorials)
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 

Último

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 

Último (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 

Introduction to java

  • 1.
  • 2. Name : Muhammad Asif Subhani Email: asif.subhani@umt.edu.pk Course Structure: Lectures: 2
  • 3.      Attendance as per university policy. However, if you do decide to join, you are not allowed to leave the class before its completion without the permission of the instructor Drink food not allowed in class Use of cell phones and similar devices is not permissible during the class. Your phones should not be visible or heard during the class Automated tools to check for plagiarism
  • 4. Quizzes (10%) Assignments (15%) Mid Term Exam (15%) Project (30%) Final Exam (30%)
  • 5.      10-15 minutes duration Will cover assignments and material covered in the class Unannounced No make-ups We will be dropping some quizzes from the final grade
  • 6.      Assignments are individual or may be in group. No late submissions I encourage you to discuss your assignments with your friends but no copying is allowed. Both the copier and the originator will get 0. 20% marks deduction on per day late submission. 100% Deduction on no submission.
  • 7.   MIDTERM:A single midterm exam that will cover all material covered till the midterm. FINAL: Will cover the entire course. The final will contain tough programming tasks
  • 8.    Project will be in group and the submission of project in deliverables. No late submission of project deliverables. Project deadline and other detail will be announced later.
  • 9.            Introduction to Java Basic I/O concepts, String, Wrapper Classes, Collections, Streams OOP Concepts – Encapsulation, Inheritance, Polymorphism OOP in Java – Inheritance, Abstract superclasses, Interfaces, Inner classes, Packages. Exception Handling Building GUIs with Swing. Components, drawing, layouts, graphics Events and Event Handling Threads and concurrency- Threads, synchronization JDBC – Database Application Networking – Client Server Application Using 3rd party API
  • 10.        Agile Development Project Management & Documentation Testing UML Diagrams Code Refactoring ,Design Pattern Version Control System Project Demos / Presentation
  • 11.    Java as a second language course ◦ Teaches programming in Java for people who already know how to program in C or similar language The Java programming language is a high-level language that can be characterized by all of the following buzzwords: ◦ Simple ◦ Object oriented ◦ Distributed ◦ Multithreaded ◦ Dynamic ◦ Architecture neutral ◦ Portable ◦ High performance ◦ Robust ◦ Secure Pre-requisites ◦ Basic programming background (C/C++) ◦ Problem solving techniques ◦ Debugging skills
  • 12.   The Java Language runs on a “Java Virtual Machine” The Java compiler (javac) compiles Java code into byte-code
  • 13.
  • 14.   Java Development Kit (JDK) is an implementation of either one of the Java SE, Java EE or Java ME platforms released by Oracle Corporation The Java platform has two components: ◦ The Java Virtual Machine ◦ The Java Application Programming Interface (API)
  • 15.      Development Tools: compiling(javac compiler), running, monitoring, debugging, and documenting (javadoc documentation )your applications. Application Programming Interface (API): The API provides the core functionality of the Java programming language.. It spans everything from basic objects, to networking and security, to XML generation and database access, and more. Deployment Technologies: Java Web Start software and Java Plug-In. User Interface Toolkits: The Swing and Java 2D toolkits. Integration Libraries: JDBC™ API, Java RMI
  • 17.  Core language ◦ Ints, array, objects, loops and conditionals  Libraries ◦ This is where the power of Java really emerges  String, ArrayList, HashMap, String Tokenizer ◦ Networking, Graphics, Database connectivity, ◦ Re-use at it’s best (so far).
  • 18.   Similar to C/C++ in syntax But eliminates several complexities of ◦ ◦ ◦ ◦ ◦   No operator overloading No direct pointer manipulation or pointer arithmetic No multiple inheritance No malloc() and free() – handles memory automatically Garbage Collector Lots more things which make Java more attractive. Avoid platform dependencies. Write once, run anywhere.
  • 20. 1 2 3
  • 22. Your first application, HelloWorldApp, will simply display the greeting "Hello world!". To create this program, you will:    Create a source file A source file contains code, written in the Java programming language, that you and other programmers can understand. You can use any text editor to create and edit source files. Compile the source file into a .class file The Java programming language compiler (javac) takes your source file and translates its text into instructions that the Java virtual machine can understand. The instructions contained within this file are known as bytecodes. Run the program The Java application launcher tool (java) uses the Java virtual machine to run your application.
  • 23. class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); } }
  • 24.         Save the code in a file with the name HelloWorldApp.java. To do this in Notepad, first choose the File > Save As menu item. Then, in the Save As dialog box: Using the Save in combo box, specify the folder (directory) where you'll save your file. In this example, the directory is java on the C drive. In the File name text field, type "HelloWorldApp.java", including the quotation marks. From the Save as type combo box, choose Text Documents (*.txt). In the Encoding combo box, leave the encoding as ANSI. When you're finished, the dialog box should look like this. The Save As dialog just before you click Save. Now click Save, and exit Notepad.
  • 25.
  • 27.     Your first application, HelloWorldApp, will simply display the greeting "Hello World!" To create this program, you will: Create an IDE project When you create an IDE project, you create an environment in which to build and run your applications. Using IDE projects eliminates configuration issues normally associated with developing on the command line. You can build or run your application by choosing a single menu item within the IDE. Add code to the generated source file A source file contains code, written in the Java programming language, that you and other programmers can understand. As part of creating an IDE project, a skeleton source file will be automatically generated. You will then modify the source file to add the "Hello World!" message. Compile the source file into a .class file The IDE invokes the Java programming language compiler (javac), which takes your source file and translates its text into instructions that the Java virtual machine can understand. The instructions contained within this file are known as bytecodes. Run the program The IDE invokes the Java application launcher tool (java), which uses the Java virtual machine to run your application.
  • 28. To create an IDE project: 1.Launch the NetBeans IDE. ◦ On Microsoft Windows systems, you can use the NetBeans IDE item in the Start menu. 2.In the NetBeans IDE, choose File | New Project.
  • 29. 3.In the New Project wizard, expand the Java category and select Java Application as shown in the following figure:
  • 30. 4.In the Name and Location page of the wizard, do the following (as shown in the figure below):  In the Project Name field, type Hello World App.  In the Create Main Class field, type helloworldapp.HelloWorldApp.  Leave the Set as Main Project checkbox selected. 5.Click Finish.
  • 31. The project is created and opened in the IDE. You should see the following components:  The Projects window, which contains a tree view of the components of the project, including source files, libraries that your code depends on, and so on.  The Source Editor window with a file called HelloWorldApp open.  The Navigator window, which you can use to quickly navigate between elements within the selected class.
  • 32. /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package helloworldapp; /** * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ public class HelloWorldApp { /** * @param args the command line arguments */ public static void main(String[] args) { System.out.println("Hello World!"); // Display the string. } }
  • 33. 6.To compile your source file, choose Run | Build Main Project from the IDE's main menu.
  • 34. 7.From the IDE's menu bar, choose Run | Run Main Project.
  • 35.        Comments are ignored by the compiler but are useful to other programmers. The Java programming language supports three kinds of comments: /* text */ The compiler ignores everything from /* to */. /** documentation */ This indicates a documentation comment (doc comment, for short). The compiler ignores this kind of comment, just like it ignores comments that use /* and */. The javadoc tool uses doc comments when preparing automatically generated documentation. For more information on javadoc, see the Javadoc™ tool documentation . // text The compiler ignores everything from // to the end of the line.
  • 36.    In the Java programming language, every application must contain a main method whose signature is: public static void main(String[] args) The modifiers public and static can be written in either order (public static or static public), but the convention is to use public static as shown above. You can name the argument anything you want, but most programmers choose "args" or "argv". The main method is similar to the main function in C and C++; it's the entry point for your application and will subsequently invoke all the other methods required by your program.
  • 37.       The main method accepts a single argument: an array of elements of type String. public static void main(String[] args) This array is the mechanism through which the runtime system passes information to your application. For example: java MyApp arg1 arg2 Each string in the array is called a command-line argument. Command-line arguments let users affect the operation of the application without recompiling it. For example, a sorting program might allow the user to specify that the data be sorted in descending order with this commandline argument: -descending The "Hello World!" application ignores its command-line arguments, but you should be aware of the fact that such arguments do exist.