Upload
reynold-baker
View
213
Download
0
Embed Size (px)
Citation preview
Copyright © Mohamed Nuzrath
Java Programming ::
Syllabus & Chapters ::
Prepared & Presented By ::
Mohamed Nuzrath [ Major In Programming ]
NCC Programme coordinator
IT Lecturer | Web Developer | Software Engineer
IDM Affiliated University College
Kandy Campus#725, Peradeniya Rd, Kandy TP +94 812224621 [email protected]
TM
Copyright © Mohamed Nuzrath
Syllabus
1. Introduction to Java 2. Language Fundamentals3. Object Oriented Programming Concepts4. Arrays5. String and String Buffer Classes6. Exception Handling7. Applets And Graphics8. Threads
Copyright © Mohamed Nuzrath
Syllabus…
9. Animation and Sounds
10.Graphical User Interface Designing [swing]
11.Files and Input/Output streams
12.System Attributes
13.Java Database Programming
14.Printing
Copyright © Mohamed Nuzrath
CH1 – Introduction to Java
The Java Technology consist of 3 entities;
1. The Java Language
2. A Runtime Environment
3. A Set of tools
Copyright © Mohamed Nuzrath
Features of Java Language
• Simple• Object Oriented• Distributed• Interpreted• Robust• Secure• Architecture Neutral
• Portable• High Performance• Multithreaded• Dynamic
Copyright © Mohamed Nuzrath
Features of Java Language
• The Java Technology consist of 3 entities;
• The Java Language
• A Runtime Environment
• A Set of tools
Copyright © Mohamed Nuzrath
The Runtime Environment
• Java Virtual Machine
Source Code Java CompilerByte Code
InstructionsJava
InterpreterMachine Code
Java Programming Environment
Execution of Java Program
Copyright © Mohamed Nuzrath
Platform Dependant System
111110000011111
101010000000011
Source Code
Compiler Intel
Compiler Sun
Windows + Intel
AMD + LINUX
Machine Code /
Binary Code /
Native Code
In a normal compiled program
Copyright © Mohamed Nuzrath
Platform Independent System
Source Code Compiler Intel
Windows + Intel
Machine Code /
Binary Code /
Native Code
In a Java Program
111110000000000
LINUX + AMD
010101010101010
Future OS with Future Processor
111111111111111
.class /Java byte code/Intermediate code
Ap
pro
pria
te
JVM
Ap
pro
pria
te
JVM
Ap
pro
pria
te
JVM
Copyright © Mohamed Nuzrath
Java is Multithreaded
ThreadA
ThreadB
ThreadC
A Java Program
Memory
Copyright © Mohamed Nuzrath
Features of Java Language
• The Java Technology consist of 3 entities;
• The Java Language
• A Runtime Environment
• A Set of tools
Copyright © Mohamed Nuzrath
Set of Tools
Tools that are provided allow developers to create java programs.
Mainly they include the java compiler interpreter and other tools needed to develop, test and debug java programs.
Copyright © Mohamed Nuzrath
Creating and Running Java Programs
Operating Instructions::.
Copyright © Mohamed Nuzrath
Creating the Source File
• Use Windows Notepad or any other pure text editor
Copyright © Mohamed Nuzrath
Loading Notepad
Start>>Programs>>Accessories>>NotepadOr Start>> Run>> Type Notepad Press Enter
Copyright © Mohamed Nuzrath
Enter the Source Code Instructions4x:
Copyright © Mohamed Nuzrath
Saving the Source Code
• Go to the required path to save• Enter the file name same as the main class
name with the extension .java• Surround both the file name and extension
within double quotes.
4x: “HelloWorld.java”
Hit the [SAVE] button
Copyright © Mohamed Nuzrath
Like this.
Copyright © Mohamed Nuzrath
Compiling the Source Code
• Java Provides a set of command line tool which can be used in building applications
• In order to compile a java source file, the path should be set,
• Once the path is correctly set the system can locate the necessary files or command line tools from the specified path.
Copyright © Mohamed Nuzrath
Start the Command Prompt
Start>>Programs>>Accessories>>Command Prompt
Copyright © Mohamed Nuzrath
Or Start it from the Run
Start >> Run >> Type CMD >> Press enter
Copyright © Mohamed Nuzrath
Navigate to the Folder
• By using MS-DOS command you can go to the folder where you have saved the Java Source Files
• MS-DOS ( Discussion)
Copyright © Mohamed Nuzrath
Compile the Program
Fix errors if any
Copyright © Mohamed Nuzrath
END OF CHAPTER 01
IF YOU FAIL TO PLAN
YOU PLAN TO FAIL
Copyright © Mohamed Nuzrath
Run the Java Program