Professional Documents
Culture Documents
01 Intro To Java Programming
01 Intro To Java Programming
01 Intro To Java Programming
INTENDED LEARNING
OUTCOME
INTRODUCTION TO Recall the basic concepts of programming.
WHAT IS WHAT IS
PROGRAMMING? PROGRAM?
Programming is the act or job of Program is a sequence of coded
creating computer programs (Merriam- instructions that can be inserted into a
Webster Dictionary) mechanism such as a computer (Merriam-
Programming is the act or process Webster Dictionary)
of writing a program so that data may be
Program is a specific set of ordered
processed by a computer (Collins
Dictionary) operations for a computer to perform.
Programming is the implementation of
(WhatIs.com)
logic to facilitate specified computing Program is a set of instructions that a
operations and functionality computer follows in order to perform a
(techopedia.com) particular task (Collins Dictionary)
WHAT IS WHAT IS
Source Object
Machine
Code Code
WHAT IS WHAT IS
INTERPETED LANGUAGE? BYTECODE LANGUAGE?
Interpreted Language is one where the Bytecode Language is a type of
instructions are not directly executed by programming language that fall under the
the target machine, but instead read and categories of both compiled and
executed by some other program (which interpreted languages because they
normally is written in the language of the employ both compilation and
native machine) interpretation to execute code
Virtual
Source Intermediate Source Machine
Interpreter ByteCode
Code Code Code
(Interpreter)
Source: thesocietea.org
JAVA SE JAVA EE
Isused to develop applications that run on Isused to create large enterprise, server-
desktop computers side, and client-side distributed
applications
Devices with different central processing Fortunately, the World Wide Web was
units (CPUs) could be connected and becoming popular and the Green Team
share the same software enhancements recognized that the Oak language was
through a single programming language perfect for developing web multimedia
This initial concept was ahead of its time, components to enhance web pages
as several deals with consumer device Initially, the Oak language was used for
companies were unsuccessful small applications, called applets, and
The Green Team was forced to find programmers using the Internet adopted
another market for their new what eventually became the Java
programming language. Programming language
PURPOSE OF A
COMPUTER PROGRAM
JAVA A computer program is a set of
instructions that run on a computer or
ENVIRONMENT other digital device
At the machine level, the program consists of
(JVM, JRE, JDK, IDE) binary instructions (1s and 0s), called
Machine code
Most programs are written in high-level
code (readable), must be translated to
machine code
PLATFORM-DEPENDENT JAVA IS
PROGRAMS PLATFORM-INDEPENDENT
JAVA PROGRAM
BASIC STRUCTURE
Source: Java Deep Learning (Awwalsoft) Source: Java Deep Learning (Awwalsoft)
}
Source: Java Deep Learning (Awwalsoft) Source: Java Deep Learning (Awwalsoft)
If JVM unable to find the required main() Acceptable changes to main() method
method the program will get a runtime syntax:
exception NoSuchMethodError: main 1. The order of modifiers (public, static) can be
The required main() method has the change
following prototype: 2. Can declare string[] in any acceptable form:
String[] args, String []args, or String args[]
To call by JVM W/o existing object JVM
anywhere has to call this method 3. Can use any valid java identifier instead of args
4. Can replace string[] with var-arg parameter.
public static void main(String[] args) Ex: main(String… args)
5. main() method can be add the following
The main() method won’t Command line modifiers: final, synchronized, strictfp
return anything to JVM arguments
Source: Java Deep Learning (Awwalsoft) Source: Java Deep Learning (Awwalsoft)
Documentation comment
JAVA COMMENTS
Single-line comment
Starts with //
Multiline comment
Begins with /* and ends with */
Documentation comment Single-line comment
This type of comment is used to produce an
HTML file that documents your program
Begins with a /** and ends with a */
Multiline comment
IDE (BASICS)
Click this to
TRY THIS: hide the
documentation
Program
Documentation
Package name
Source Code Filename
Class name
main() Method
Class name
Output Window