Professional Documents
Culture Documents
Java Lecture #
Java Lecture #
Science
Islamic Republic of Afghanistan
Ministry of Higher Education
Kabul University
Physics Faculty
Programming Fundamentals
JAVA 1
07/19/2023 8
Badakhshan University Faculty of Computer 8
Science
Java vs. JavaScript
JavaScript is a different language from Java, albeit with some similarities.
A JavaScript program is written in the HTML page, and executed by the
JavaScript interpreter, so also allows dynamic web page content in the browser
window.
JavaScript is special purpose - it is an object-based language that deals directly
with browser entities like windows, text fields, forms, frames and documents.
JavaScript can respond to browser events like mouse clicks and user-typed text.
JavaScript is fast to write, but not as powerful as Java.
07/19/2023 10
Badakhshan University Faculty of Computer 10
Science
Getting Started with Java Programming
Writing Java Code
Compiling Programs
Executing Applications
07/19/2023 11
Badakhshan University Faculty of Computer 11
Science
A Simple Application
Example 1.1
//This application program prints Welcome to Java!
package chapter1;
07/19/2023 12
Badakhshan University Faculty of Computer 12
Science
First Simple Example
package javaapplication1;
}}
Email: mqm.dacaar@gmail.com
Phone: +0789152242