SlideShare uma empresa Scribd logo
1 de 56
Learning Java
DeAnna Riddlespur
Spring 2014
Introduction to Computers,
Programs, And Java
Objectives
●

●

●

●

To Understand computer basics, programs, and
operating systems
To describe the relationship between Java and the
World Wide Web
The understand the meaning of Java language
specification, AOI, JDK, and IDE
To write a simple Java program
Objectives
●

To display output on the console

●

To explain the basic syntax of a Java Program

●

To create, compile and run Java programs

●

●

●

To display output using the JOptionPane message
dialog boxes
To become famiiar with Java programming style and
documentaton.
To explain the differences between syntax errors,
runtime errors and logic errors
Introduction
The central theme we focus on is to learn how to solve
problems by writing a program
●

●

●

What is programming? The term programming
means to create( or develop) software, which is also
called a program.
Software contains the instructions that tell a
computer ( or device) what to do.
Programming languages are powerful tools that
software developers use to create software.
●

●

●

There are many programming languages
Each language was invented for a specific purposeto build on the strengths of a previous language or to
give the programmer a new and unique set of tools.
The key is to learn how to solve a problem using a
programming approach.
1.2 What is a computer?

A computer is an electronic device that stores and processes data.
●

●

●

●

A computer includes both hardware and software.
Hardware - comprises the visible, physical elements of the
compute
Software - provides the invisible instructions that control the
hardware and make it perform a specific task.
Knowing computer hardware can help you better understand
the effects that a program's instructions have on the computer
and its components.
Computer Components
●

Central Processing unit(CPU)

●

Memory ( main memory)

●

Storage devices ( disks and CDs)

●

Input devices ( mouse and keyboard)

●

Output devices ( such as monitors and printers)

A computer's components are interconnected by a
subsystem called a bus.
●

●

●

●

●

●

Motherboard is a circuit case that connects all of the
parts of a computer together
The bus is build into the computer's motherboard.
The central processing unit (CPU) is the
computer's brain.It retrieves instructions frommemory
and executes them.
The CPU usually has two components
---The control unit controls and coordinates the
actions of the other components.
---The arithmetic/logic unit performs numeric
operations ( addition, subtraction, multiplication,
division) and logical operations ( comparisions )
●

●

●

●

●

●

CPUs are build on small silicon semiconductor chips
tht contain millions of tiny electric switches called
transistors for processing information.
The internal clock emits electronic pusles at a
constant rate. These pulses are used to control and
synchronize the pace of operations.
A higher clock speed enables more instructions to be
executed in a given period of time.
The unit of measurement of clock speed is the hertz
(Hz), with 1 hertz equaling 1 pulse per second.
In the 1990's computers measured clocked speed in
megahertz(MHz)
The clock speed of a computer is now usually stated
in gigahertz (GHz)
●

●

●

●

●

CPUs were oriinally developed with only one core.
The core is the part of the processor that performs
the reading and executing of instructions.
Multicore CPU is a single component with two or
more independent processors.
A computer is nothing more than a series of
switches.
Each switch exists in two states : on or off

●

If the switch is on its value is 1

●

If the switch is off the value is 0

●

These 0s and 1s are interpreted as digits in the
binary number system and are called bits ( binary
digits)
●

Storing information in a computer is simply a matter
of setting a sequence of switches on or off.

●

The minimum storage unit in a computer is a byte

●

A byte is composed of eight bits

●

●

●

●

To store a number that cannot fit into a single byte,
the computer uses several bytes.
An encoding scheme is a set of rules that govern
how a computer translates characters, numbers and
symbols into data the computer can actually work
with.
Most schemes translate each character into a
predetermined string of numbers
●

In ASCII encoding scheme the character c is
represented by 01000011 in one byte.

Computer's storage capacity
●

Kilobyte(KB) 1,000 bytes

●

megabyte(MB) 1 million bytes

●

Gigabyte (GB) 1 billion bytes

●

Terabyte(TB) 1 trillion bytes

1 MB can store 50 pages of documents .
1 GB can store 50,000 pages of documents.
Two hour high resolution movie 8 GB
●

●

●

●

●

A computer's memory consists of an ordered
sequence of bytes for storing programs as well as
data that the program is working with
Memory is like the computer's work area for
executing a program
A program and its data must be moved into the
computer's memory before they can be executed by
the CPU
Every byte in the memory has a unique address
The unique address is used to locate the byte for
storing and retreiving data.
●

●

●

●

●

Memory is also referred to as random access
memory(RAM)
Because the bytes in the memory can be accessed
in any order the memory is also referred to as
random access memory
The more RAM a computer has, the faster it can
operate. But there are limits
A memory byte is never empty, but its initial content
may be meaningless to your program
Current content of a memory byte is lost when new
information is placed in it.
●

●

●

●

●

●

Memory is built on silicon semiconductor chips that
have millions of transistors embedded on their
surface.
Compared to CPU chips, memory chips are less
complicated, slower, and less expensive.
RAM is a volatile form of data storage
Volatile means any information that has been stored
in memory si lost when the system's power is turned
off
Programs and data are permanently stored on
storage devices
Programs and data are moved to memory when the
computer actually uses them.
Three main types of storage devices:
●

Magnetic disk drives

●

Optical disc drives (CD and DVD)

●

USB flash drives

●

●

●

●

●

--Drives are devices for operating a medium.
----A storage medium physically stores data and
program instructions.
Hard disks are used for permanently storing data
and programs
CD stands for compact disc
CD-R is for read only permanent storage; the user
cannot modify its contents once they are recorded
●

●

●

●

●

CD-RW can be used like a hard disk; you can write
data onto the disc and then over wtite that data with
new data
DVD digital versatile disc or digital video disc
Universal serial bus (USB) connectors allow the
user to attach many kids of peripheral devices to the
computer.
A USB flash drive is a device for storing and
transporting data .
A flash drive acts like a protable hard drive that can
be plugged intor your computer's USB port.
●

Input and output devices let the user communicate
with the computer

●

A keyboard is a device for entering input

●

A keyboard consists of the keys for entering input

●

●

●

●

Function keys are located across the top of the
keyboard and are prefaced with the letter F.
A modifier key is a special key that modifies the
normal action of another key when the two are
pressed at the same time
The numberic keypad is located on the right side of
most keyboards, it is a spearate set of keys styled
like a claculator to use for entering numbers quickly.
Arrow keys, are used to move the mouse on the
screen in many kinds of programs
●

The insert delete page up and page down keys
are used in word processing and other programs for
inserting text and objects, deleting text and objects
and moving up or down through a document one
screen at a time

●

●

●

●

A mouse is a pointing device
A cursor is a graphical pointer ( usually in the shape
of an arrow)
The monitor displays information. The screen
resolution and dot pitch determine the quality of the
display
The screen resloution specifies the number of
pixels in horizontal and vertical dimensions of the
display device.
●

●

●

●

●

●

●

Pixesl (picture elements) are tiny dots that form an
image on the screen
Dot pitch is the amount of space between mizels,
measured in milimeters.
The smaller the dotpitch the sharper the display.
A modem uses a phone line and can transfer data
at a speed up to 56,000bps ( bits per second)
A digital subscriber line(DSL) connection also uses
a standard phone line but it can transfer data 20 time
faster than a standard dial up
A cable modem uses the cable TV line maintained
by the cable company and is generally faster than
DSL
A network interface card(NIC) is a device that
connects a computer to a local area network .
●

●

Wireless networking is available in homes
businesses and schools.
A wireless adapter enables the computer to connect
to a local area network and the internet.

Computer programs, known as software, are
instructions that tell a computer what to do .Computers
do not understand human languages so programs must
be written in a language a computer can use. All
programs must be converted into a language the
computer can understand.
●

●

Machine Language-a computer's native language – a
set of built in primitive instructions
These instructions are in the form of binary code.
●

●

●

●

●

Assembly language uses a short descriptive word
known as a mnemonic to represent each of the
machine language instructions.
The mnemonic add typically means to add numbers
and sub means to subtract the numbers
Assembly languages were developed to make
programming easier
An assembler is a program used to translate
assembly language programs into machine code.
Assembly language is referred to as a low level
language because assembly language is close in
nature to machine language and is machine
dependent.
●

●

●

●

●

●

●

High level languages are platform independent
Platform indemendent means that you can write a
program in a high level language and run it in
different types of machines.
Higl level languages are english like and easy to
learn and use
The instructions in a high level programming
language are called statements.
A program written n a high level language is called
a source program or source code
A source program must be translated into machine
code for execution.
Translation can be done using an interpreter or a
compiler
●

An interpreter reads one statement from the source
code translates it to the machine code or virtual
machine code and then executes it right away.
Popular Programming
Languages
Ada
●

Named for Ada lovelace, who worded on mechanical
general- purpose computers. The Ada language was
developed for the Department of Defense and is
used mainly in defense projects

BASIC
●

Beginner's All purpose Symbolic Instruction Code. It
was designed to be learned and used easily by
beginners.
C
●

●

Developed at Bell Laboraories.
C combines the power of an assembly language with
the ease of use and portability of a high level
language

C++
●

C++ is an object oriented language, based on C

C#
●

●

Pronounced “C Sharp”
it is a hybrid of Java and C++ and was developed by
Microsoft.

COBOL
●

Common Business Oriented Language

●

Used for business applications
FORTRAN
●

●

FORmula TRANslation.
Popular for scientific and mathematical applications.

Java
●

Developed by Sun Microsystems

●

Now a part of oracle

●

It is widely used for developing platform independent
internet applications

Pascal
●

●

Named for Blaise Pascal who pioneered calculating
machines in the seventeenth century
It is a simple structured general purpose language
primarly for teaching programming
Python
●

A sinple general purpose scripting language good for
writing short programs

Visual Basic
●

●

Visual Basic was developed by microsoft
Enables the programmers to rapidly develop
graphical user interfaces
●

●

An interpreter translates and executes a program
one statement at a time
A compiler translates the entire source program into
a machine language file for execution

The operating system(OS) is the most important
program that runs on a computer The OS manages and
controls a computer's activities.
●

●

●

The popular operating systems for general purpose
computers are
Microsoft Windows, Mac OS and Linus
Application programs cannot run unless and
operating system is installed and running on the
computer.
Major Tasks of an Operating
system
●

Controlling and monitoring system activities

●

Allocating and assigning system resources

●

Scheduling operations
●

●

●

●

●

●

●

Operating systems perform basic tasks
An operating system must also ensure that different
programs and users working at the same time do not
interfere with each other.
The OS is responsible for security, ensuring tht
unauthorized users and programs do not access the
system.
The OS is responsible for determining what computer
resources a program needs and for allocating and
assigning them to run the program
The OS is responsible for scheduling programs'
activities to make efficient use of system resources.
Multiprogramming allows multiple programs to run
simultaneously by sharing the same CPU
Multithreading allows a single program to execute
multple tasks at the same time
●

●

Multiprocessing or parallel processing uses two
or more processors together to perform subtasks
concurrently and then combine solutions of the
subtasks to obtain a solution for the entire task.
It is like a surgucal operation where several doctors
work together on one patient.
Java, the World Wide Web
and Beyond
Java is a powerful and versatile programming
language for developing software running on mobile
devices, desktop computers and servers.
Java was developed by a team ed by James Gosling at
Sun Microsystems. Originally called Oak, Java was
designed in 1991 for use in embedded chips in
consumer electronic appliances. In 1995 , renamed
Java it was redesigned for developing Web applications.
●

●

●

●

Java is popular particularly because of its promise
that you can write a program once and run it
anywhere
Java is simple, object oriented, distributed,
interpreted, robust, secure, architechure neutral,
protable, high performance, multithreaded and
dynamic.
Java is a full- featured, general- purpose
programming language that can be used to develop
robust mission- critical applications.
Java was used to develop the code to communicate
with and control the robotic rover on Mars.
●

●

●

●

●

The World Wide Web is an electronic information
repository that can be accessed on the Internet from
anywhere in the world.
The internet has been around for more than forty
years.
Java became attractive because Java programs
can be run from a Web browser.
Java programs run in a Web browser are called
applets
Applets employ a modern graphical interface with
buttons, text fields, text areas, radio buttons and
more
●

●

●

●

●

●

Applets make the Web responsive, interactive, and
fun to use
Applets are embedded in an HTML file
HTML( Hypertext Markup Language) is a simple
scripting language for laying out documents, linking
documents on the internet and bringing images,
sound and video alive on the Web.
Java is very popular for developing applications of
Web Servers
Java is a versatile programming language
You can use java to develop applications for desktop
computers servers and small hand held devices
The software for Android cell phones is
developed using Java
The Java Language Specification,Api,JDK, and
IDE

●

Java syntax is defined in the Java language
specification, and the Java library is defined in the
Java API, The JDK is the software for developing and
running Java programs. An IDE is an integrated
development environment to rapidly developing
programs
●

●

●

●

●

Computer languages have strict rules of usage
If you do not follow the rules the computer will not be
able to understand
The Java language specification and the Java API
define the Java standards.
The Java language specification is a dechnical
definition of the Java programming language's syntax
and semantcs

application program interface ( API)
also known as the library contains
The

predefined classes and interfaces for developing
Java programs.
Three Editions of Java
●

●

●

Java Standard Edition (Java SE) to develop clientside standalone applications or applets
Java Enterprise Edition ( Java EE) to develop serverside applications, such as Java servelets, JavaServer
Pages (JSP) and JavaServer Faces (JSF)
Java Micro Edition ( Java ME) to develop
applications for mobile devices.

Java SE is the foundation upon which all other Java
technology is based.
●

The Java Development Toolkit is called JDK
●

●

JDK consists of a set of separate programs, each
invoked from a command line for developing and
testing Java prorams.
Java development tools

----NetBeans
----Eclipse
---Textpad
●

●

Software that provides and integrated development
enviorment ( IDE) for developing Java programs
quickly
Editing, compiling, building, debugging and online
help are integrated in one graphical user interface
A simple Java Program
A Java program is executed from the main
method in the class.
●

●

●

Console- an old computer term that refers to the text
entry and display device of a computer
Console input means to receive input from the
keyboard
Console output means to display output on the
monitor
1 public class Welcome {
2
public static void main
( String [] args) {
3
//Display message Welcome
to Java! On the console
4
System.out.println(“Welcome
to Java!”);
5
6}

}
Note the line numbers are for
reference purposes only!!!!
Line 1 defines a class.
●

Every Java program must have at least one class

●

Each class has a name

●

Class names start with an uppercase letter.

●

Out class name in the example is Welcome
Line 2 defines the main method

●

●

●

The program is executed from the main
method
A class may contain several methods
The main method is the entry point
where the program begins execution
●

●

●

●

●

●

●

A method is a construct that contains statements
The main method in our program contains the
System.out.println statement
This statements displays the string on the console
String is a programming term meaning a sequence of
characters
A string must be enclosed in double quotation marks
Every statement in Java ends with a semicolon(;)
known as the statement terminator
Reserved words or keywords have a specific
meaning to the compiler and cannot be used for
other purposes in the program
●

●

●

●

●

●

Class compiler understands that the word after
class is the name for the class
Public, static, and void are also reserved words
in Java
Line 3 is a comment that documents what the
program is and how it is constructed
Comments help programmers to communicate and
understand the program
Comments are ignored by the compiler
Comments are preceded by two slashes (//) on a
line called a line comment or enclosed between /*
and */ on one or several lines
●

●

●

●

●

●

●

Block or paragraph comments are on several lines
When the compiler sees // it ignors all text after // on
the same line
When it sees /* it scans for the next / and ignores any
text between /* and*/
A pair of curly braces in a program forms a block
that groups the program's components.
In Java each bock begins with an opening brace ({)
and ends with a closing brace (})
Every class has a class block that groups the data
and methods of the class.
Every method has a method block that groups the
statements in a method
●

●

●
●

Blocks can be nested meaning that one
block can be placed within another

An opening brace must be matched by a
closing brace
Java source programs are case sensitive
Main and main do not mean the same
thing.
Special Characters
●

●

The most common errors made as one
learns to program are syntax errors
The multiplication operator in Java is *
Create, Compiling and
Executing a Java Program
●

●

●

●

You save a Java program in a .java file and compile it into
a .class file. The .class file is executed by the Java Virtual
Machine.
You have to create your program and compile it before it
can be executed.
If your program has errors you have to modify it to fix
them then recompile it
The rourse file must have the same exact name as the
public class name
●

A java compiler translates a Java source
file into a Java bytecode file
To compile Welcome.java:
javac Weclome.java

●

If you have no syntax errors, the compiler
generates a bytecode file with a .class
extension.
●

The java language is a high level language

●

Java bytecode is a low level language

●

●

●

●

●

Bytecode is similar to machine instructions but is
architecture neutral and can run on any platform that has
a JVM
The virtual machine is a program that interprets Java
bytecode
Java bytecode can run on a variety of hardware platforms
and operating systems
Java source code is compiled into Javabytecode and
Java bytecode is interpreted by the JVM
The JVM executes your code along with the code in the
library
●

●

●

●

●

●

To extcute a java program is to run the program's
bytecode
You can execute the bytecode on any platfor with a JVM
The JVM translates the individual instructions in the
bytecode into the target machine language code one at a
time rather than the whole program as a single unit
Each step is executed immediately after it is translated.
If you execute a file that does not exist a
NoCLassDefFoundError will occur
If you execute a class file that does not have a main
method or you mistyped the main method a
NoSuchMethodError will occur
●

●

●

The JVM first loads the bytecode of the class to memory
using a program called the class loader
If your program uses other classes the class loader
dynamically loads them just before they are needed
After a class is loaded the JVM uses a program called the
bytecode verifier to check the validity of the bytecode and
to ensure that the bytecode does not violate Java's
security restrictions
Displaying Text in a Message
Dialog Box
You can display text in a graphical dialog box
●

●

To display text in a message dialog box you need to use
the showMessageDialog method in the JOptionPane
class
JOptionPane is one of the many predefined classes in
the java library
WelcomeInMessageDialogBox.java
1 /* This application program displays Welcome to Java!
2 * in a message dialog box.
3 */
4 import javax.swing.JOptionPane;
5
6 public class WelcomeInMessageDialogBox {
7 public static void main(String[] args) {
8 // Display Welcome to Java! In message dialog box
9 JoptionPane.showMessageDialog(null,”Welcome to Java!”):
10}
11}

Mais conteúdo relacionado

Mais procurados

A+ certification (Core hardware) Pc Maintenance
 A+ certification (Core hardware) Pc Maintenance  A+ certification (Core hardware) Pc Maintenance
A+ certification (Core hardware) Pc Maintenance muhammadishrat11
 
Basic Computer Concepts
Basic Computer ConceptsBasic Computer Concepts
Basic Computer ConceptsReynz Anario
 
Lecture 2 - Computer Hardware & Operating Systems
Lecture 2 - Computer Hardware & Operating SystemsLecture 2 - Computer Hardware & Operating Systems
Lecture 2 - Computer Hardware & Operating SystemsJack Hyman
 
Basic computer fundamentals
Basic computer fundamentalsBasic computer fundamentals
Basic computer fundamentalsRahul Sharma
 
The Basic Configuration of a Microcomputer
The Basic Configuration of a Microcomputer The Basic Configuration of a Microcomputer
The Basic Configuration of a Microcomputer Taminul Islam
 
Mca i-fundamental of computer-u-1-computer hardware system
Mca  i-fundamental of  computer-u-1-computer hardware systemMca  i-fundamental of  computer-u-1-computer hardware system
Mca i-fundamental of computer-u-1-computer hardware systemRai University
 
5 computer memory
5 computer memory5 computer memory
5 computer memoryBaliThorat1
 
4 computer languages
4 computer languages4 computer languages
4 computer languagesBaliThorat1
 
1 fundamentals of computer
1 fundamentals of computer1 fundamentals of computer
1 fundamentals of computerBaliThorat1
 
COMPONENTS OF COMPUTER SYSTEM
COMPONENTS OF COMPUTER SYSTEMCOMPONENTS OF COMPUTER SYSTEM
COMPONENTS OF COMPUTER SYSTEMJelly Flores
 
Chapter1 introduction to computer systems
Chapter1 introduction to computer systemsChapter1 introduction to computer systems
Chapter1 introduction to computer systemsMuhammad Waqas
 
Basic components, memory
Basic components, memoryBasic components, memory
Basic components, memoryAnthony Alleyne
 
Computer for class 6th
Computer for class 6thComputer for class 6th
Computer for class 6thRuchi Gupta
 
Computer Hardware
Computer HardwareComputer Hardware
Computer Hardwarenitinmote
 

Mais procurados (20)

A+ certification (Core hardware) Pc Maintenance
 A+ certification (Core hardware) Pc Maintenance  A+ certification (Core hardware) Pc Maintenance
A+ certification (Core hardware) Pc Maintenance
 
Introduction to computer system
Introduction to computer systemIntroduction to computer system
Introduction to computer system
 
Basic Computer Concepts
Basic Computer ConceptsBasic Computer Concepts
Basic Computer Concepts
 
General computer - Introduction to computers
General computer - Introduction to computersGeneral computer - Introduction to computers
General computer - Introduction to computers
 
Lecture 2 - Computer Hardware & Operating Systems
Lecture 2 - Computer Hardware & Operating SystemsLecture 2 - Computer Hardware & Operating Systems
Lecture 2 - Computer Hardware & Operating Systems
 
Basic computer fundamentals
Basic computer fundamentalsBasic computer fundamentals
Basic computer fundamentals
 
The Basic Configuration of a Microcomputer
The Basic Configuration of a Microcomputer The Basic Configuration of a Microcomputer
The Basic Configuration of a Microcomputer
 
Unit 1 and 2 review
Unit 1 and 2 reviewUnit 1 and 2 review
Unit 1 and 2 review
 
Mca i-fundamental of computer-u-1-computer hardware system
Mca  i-fundamental of  computer-u-1-computer hardware systemMca  i-fundamental of  computer-u-1-computer hardware system
Mca i-fundamental of computer-u-1-computer hardware system
 
5 computer memory
5 computer memory5 computer memory
5 computer memory
 
4 computer languages
4 computer languages4 computer languages
4 computer languages
 
Computer components
Computer componentsComputer components
Computer components
 
Basic computer terms
Basic computer termsBasic computer terms
Basic computer terms
 
1 fundamentals of computer
1 fundamentals of computer1 fundamentals of computer
1 fundamentals of computer
 
COMPONENTS OF COMPUTER SYSTEM
COMPONENTS OF COMPUTER SYSTEMCOMPONENTS OF COMPUTER SYSTEM
COMPONENTS OF COMPUTER SYSTEM
 
Fundamental of Computers
Fundamental of ComputersFundamental of Computers
Fundamental of Computers
 
Chapter1 introduction to computer systems
Chapter1 introduction to computer systemsChapter1 introduction to computer systems
Chapter1 introduction to computer systems
 
Basic components, memory
Basic components, memoryBasic components, memory
Basic components, memory
 
Computer for class 6th
Computer for class 6thComputer for class 6th
Computer for class 6th
 
Computer Hardware
Computer HardwareComputer Hardware
Computer Hardware
 

Semelhante a Java 101 @ chattahoochee

Supplementary Reading 01 - Introduction to computers, programs and java.pdf
Supplementary Reading 01 - Introduction to computers, programs and java.pdfSupplementary Reading 01 - Introduction to computers, programs and java.pdf
Supplementary Reading 01 - Introduction to computers, programs and java.pdfAshirHussain6
 
Computer System Overview Class XI CS
Computer System Overview Class XI CSComputer System Overview Class XI CS
Computer System Overview Class XI CSclass12sci
 
Chapter 1-1 _ Computers and Software in Networks.pdf
Chapter 1-1 _ Computers and Software in Networks.pdfChapter 1-1 _ Computers and Software in Networks.pdf
Chapter 1-1 _ Computers and Software in Networks.pdfAfendeyAthurJinir
 
Chapter 1-1 Computers and Software in Networks.pptx
Chapter 1-1  Computers and Software in Networks.pptxChapter 1-1  Computers and Software in Networks.pptx
Chapter 1-1 Computers and Software in Networks.pptxAfendeyAthurJinir
 
Software and hardware
Software and hardwareSoftware and hardware
Software and hardwaremeryy21
 
Explain in detail 11th Standard Samacheer kalvi
Explain in detail 11th Standard Samacheer kalviExplain in detail 11th Standard Samacheer kalvi
Explain in detail 11th Standard Samacheer kalviVinoth Kanna
 
Chapter 01 Java Programming Basic Java IDE JAVA INTELLIEJ
Chapter 01 Java Programming Basic Java IDE JAVA INTELLIEJChapter 01 Java Programming Basic Java IDE JAVA INTELLIEJ
Chapter 01 Java Programming Basic Java IDE JAVA INTELLIEJIMPERIALXGAMING
 
Programming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages ConceptsProgramming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages Conceptsimtiazalijoono
 
Basic computer hardware and software
Basic computer hardware and softwareBasic computer hardware and software
Basic computer hardware and softwareDr. Ahmed Al Zaidy
 
IGCSE_ICT_Chapter 1.pptx
IGCSE_ICT_Chapter 1.pptxIGCSE_ICT_Chapter 1.pptx
IGCSE_ICT_Chapter 1.pptxFatimaWaheed30
 
Pre requisite of COA- for Micro controller Embedded systems
Pre requisite of COA- for Micro controller Embedded systemsPre requisite of COA- for Micro controller Embedded systems
Pre requisite of COA- for Micro controller Embedded systemsSMITA V MORE
 
COMPUTER HARDWARE AND SOFTWARE.pptx
COMPUTER HARDWARE  AND SOFTWARE.pptxCOMPUTER HARDWARE  AND SOFTWARE.pptx
COMPUTER HARDWARE AND SOFTWARE.pptxAbhishek Sonker
 
Programming for Problem Solving
Programming for Problem SolvingProgramming for Problem Solving
Programming for Problem SolvingSukhendra Singh
 
UNIT1IT SKILLS.pptx
UNIT1IT SKILLS.pptxUNIT1IT SKILLS.pptx
UNIT1IT SKILLS.pptxsamreen82
 
Chapter 5. computer system
Chapter 5. computer systemChapter 5. computer system
Chapter 5. computer systemAshish KC
 
Computer essential
Computer essentialComputer essential
Computer essentialMusa Bukar
 
Computer Architecture in Organisation - COMP 3114 - LECTURE NOTES - 2023-2024...
Computer Architecture in Organisation - COMP 3114 - LECTURE NOTES - 2023-2024...Computer Architecture in Organisation - COMP 3114 - LECTURE NOTES - 2023-2024...
Computer Architecture in Organisation - COMP 3114 - LECTURE NOTES - 2023-2024...SaffaIbrahim1
 

Semelhante a Java 101 @ chattahoochee (20)

Supplementary Reading 01 - Introduction to computers, programs and java.pdf
Supplementary Reading 01 - Introduction to computers, programs and java.pdfSupplementary Reading 01 - Introduction to computers, programs and java.pdf
Supplementary Reading 01 - Introduction to computers, programs and java.pdf
 
Computer System Overview Class XI CS
Computer System Overview Class XI CSComputer System Overview Class XI CS
Computer System Overview Class XI CS
 
Chapter 1-1 _ Computers and Software in Networks.pdf
Chapter 1-1 _ Computers and Software in Networks.pdfChapter 1-1 _ Computers and Software in Networks.pdf
Chapter 1-1 _ Computers and Software in Networks.pdf
 
Chapter 1-1 Computers and Software in Networks.pptx
Chapter 1-1  Computers and Software in Networks.pptxChapter 1-1  Computers and Software in Networks.pptx
Chapter 1-1 Computers and Software in Networks.pptx
 
Software and hardware
Software and hardwareSoftware and hardware
Software and hardware
 
Explain in detail 11th Standard Samacheer kalvi
Explain in detail 11th Standard Samacheer kalviExplain in detail 11th Standard Samacheer kalvi
Explain in detail 11th Standard Samacheer kalvi
 
Chapter 01 Java Programming Basic Java IDE JAVA INTELLIEJ
Chapter 01 Java Programming Basic Java IDE JAVA INTELLIEJChapter 01 Java Programming Basic Java IDE JAVA INTELLIEJ
Chapter 01 Java Programming Basic Java IDE JAVA INTELLIEJ
 
Programming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages ConceptsProgramming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages Concepts
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
Basic computer hardware and software
Basic computer hardware and softwareBasic computer hardware and software
Basic computer hardware and software
 
Computer basics
Computer basicsComputer basics
Computer basics
 
IGCSE_ICT_Chapter 1.pptx
IGCSE_ICT_Chapter 1.pptxIGCSE_ICT_Chapter 1.pptx
IGCSE_ICT_Chapter 1.pptx
 
Pre requisite of COA- for Micro controller Embedded systems
Pre requisite of COA- for Micro controller Embedded systemsPre requisite of COA- for Micro controller Embedded systems
Pre requisite of COA- for Micro controller Embedded systems
 
COMPUTER HARDWARE AND SOFTWARE.pptx
COMPUTER HARDWARE  AND SOFTWARE.pptxCOMPUTER HARDWARE  AND SOFTWARE.pptx
COMPUTER HARDWARE AND SOFTWARE.pptx
 
Computer.pptx
Computer.pptxComputer.pptx
Computer.pptx
 
Programming for Problem Solving
Programming for Problem SolvingProgramming for Problem Solving
Programming for Problem Solving
 
UNIT1IT SKILLS.pptx
UNIT1IT SKILLS.pptxUNIT1IT SKILLS.pptx
UNIT1IT SKILLS.pptx
 
Chapter 5. computer system
Chapter 5. computer systemChapter 5. computer system
Chapter 5. computer system
 
Computer essential
Computer essentialComputer essential
Computer essential
 
Computer Architecture in Organisation - COMP 3114 - LECTURE NOTES - 2023-2024...
Computer Architecture in Organisation - COMP 3114 - LECTURE NOTES - 2023-2024...Computer Architecture in Organisation - COMP 3114 - LECTURE NOTES - 2023-2024...
Computer Architecture in Organisation - COMP 3114 - LECTURE NOTES - 2023-2024...
 

Último

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: 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
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Último (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: 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 .
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

Java 101 @ chattahoochee

  • 2. Introduction to Computers, Programs, And Java Objectives ● ● ● ● To Understand computer basics, programs, and operating systems To describe the relationship between Java and the World Wide Web The understand the meaning of Java language specification, AOI, JDK, and IDE To write a simple Java program
  • 3. Objectives ● To display output on the console ● To explain the basic syntax of a Java Program ● To create, compile and run Java programs ● ● ● To display output using the JOptionPane message dialog boxes To become famiiar with Java programming style and documentaton. To explain the differences between syntax errors, runtime errors and logic errors
  • 4. Introduction The central theme we focus on is to learn how to solve problems by writing a program ● ● ● What is programming? The term programming means to create( or develop) software, which is also called a program. Software contains the instructions that tell a computer ( or device) what to do. Programming languages are powerful tools that software developers use to create software.
  • 5. ● ● ● There are many programming languages Each language was invented for a specific purposeto build on the strengths of a previous language or to give the programmer a new and unique set of tools. The key is to learn how to solve a problem using a programming approach.
  • 6. 1.2 What is a computer? A computer is an electronic device that stores and processes data. ● ● ● ● A computer includes both hardware and software. Hardware - comprises the visible, physical elements of the compute Software - provides the invisible instructions that control the hardware and make it perform a specific task. Knowing computer hardware can help you better understand the effects that a program's instructions have on the computer and its components.
  • 7. Computer Components ● Central Processing unit(CPU) ● Memory ( main memory) ● Storage devices ( disks and CDs) ● Input devices ( mouse and keyboard) ● Output devices ( such as monitors and printers) A computer's components are interconnected by a subsystem called a bus.
  • 8. ● ● ● ● ● ● Motherboard is a circuit case that connects all of the parts of a computer together The bus is build into the computer's motherboard. The central processing unit (CPU) is the computer's brain.It retrieves instructions frommemory and executes them. The CPU usually has two components ---The control unit controls and coordinates the actions of the other components. ---The arithmetic/logic unit performs numeric operations ( addition, subtraction, multiplication, division) and logical operations ( comparisions )
  • 9. ● ● ● ● ● ● CPUs are build on small silicon semiconductor chips tht contain millions of tiny electric switches called transistors for processing information. The internal clock emits electronic pusles at a constant rate. These pulses are used to control and synchronize the pace of operations. A higher clock speed enables more instructions to be executed in a given period of time. The unit of measurement of clock speed is the hertz (Hz), with 1 hertz equaling 1 pulse per second. In the 1990's computers measured clocked speed in megahertz(MHz) The clock speed of a computer is now usually stated in gigahertz (GHz)
  • 10. ● ● ● ● ● CPUs were oriinally developed with only one core. The core is the part of the processor that performs the reading and executing of instructions. Multicore CPU is a single component with two or more independent processors. A computer is nothing more than a series of switches. Each switch exists in two states : on or off ● If the switch is on its value is 1 ● If the switch is off the value is 0 ● These 0s and 1s are interpreted as digits in the binary number system and are called bits ( binary digits)
  • 11. ● Storing information in a computer is simply a matter of setting a sequence of switches on or off. ● The minimum storage unit in a computer is a byte ● A byte is composed of eight bits ● ● ● ● To store a number that cannot fit into a single byte, the computer uses several bytes. An encoding scheme is a set of rules that govern how a computer translates characters, numbers and symbols into data the computer can actually work with. Most schemes translate each character into a predetermined string of numbers
  • 12. ● In ASCII encoding scheme the character c is represented by 01000011 in one byte. Computer's storage capacity ● Kilobyte(KB) 1,000 bytes ● megabyte(MB) 1 million bytes ● Gigabyte (GB) 1 billion bytes ● Terabyte(TB) 1 trillion bytes 1 MB can store 50 pages of documents . 1 GB can store 50,000 pages of documents. Two hour high resolution movie 8 GB
  • 13. ● ● ● ● ● A computer's memory consists of an ordered sequence of bytes for storing programs as well as data that the program is working with Memory is like the computer's work area for executing a program A program and its data must be moved into the computer's memory before they can be executed by the CPU Every byte in the memory has a unique address The unique address is used to locate the byte for storing and retreiving data.
  • 14. ● ● ● ● ● Memory is also referred to as random access memory(RAM) Because the bytes in the memory can be accessed in any order the memory is also referred to as random access memory The more RAM a computer has, the faster it can operate. But there are limits A memory byte is never empty, but its initial content may be meaningless to your program Current content of a memory byte is lost when new information is placed in it.
  • 15. ● ● ● ● ● ● Memory is built on silicon semiconductor chips that have millions of transistors embedded on their surface. Compared to CPU chips, memory chips are less complicated, slower, and less expensive. RAM is a volatile form of data storage Volatile means any information that has been stored in memory si lost when the system's power is turned off Programs and data are permanently stored on storage devices Programs and data are moved to memory when the computer actually uses them.
  • 16. Three main types of storage devices: ● Magnetic disk drives ● Optical disc drives (CD and DVD) ● USB flash drives ● ● ● ● ● --Drives are devices for operating a medium. ----A storage medium physically stores data and program instructions. Hard disks are used for permanently storing data and programs CD stands for compact disc CD-R is for read only permanent storage; the user cannot modify its contents once they are recorded
  • 17. ● ● ● ● ● CD-RW can be used like a hard disk; you can write data onto the disc and then over wtite that data with new data DVD digital versatile disc or digital video disc Universal serial bus (USB) connectors allow the user to attach many kids of peripheral devices to the computer. A USB flash drive is a device for storing and transporting data . A flash drive acts like a protable hard drive that can be plugged intor your computer's USB port.
  • 18. ● Input and output devices let the user communicate with the computer ● A keyboard is a device for entering input ● A keyboard consists of the keys for entering input ● ● ● ● Function keys are located across the top of the keyboard and are prefaced with the letter F. A modifier key is a special key that modifies the normal action of another key when the two are pressed at the same time The numberic keypad is located on the right side of most keyboards, it is a spearate set of keys styled like a claculator to use for entering numbers quickly. Arrow keys, are used to move the mouse on the screen in many kinds of programs
  • 19. ● The insert delete page up and page down keys are used in word processing and other programs for inserting text and objects, deleting text and objects and moving up or down through a document one screen at a time ● ● ● ● A mouse is a pointing device A cursor is a graphical pointer ( usually in the shape of an arrow) The monitor displays information. The screen resolution and dot pitch determine the quality of the display The screen resloution specifies the number of pixels in horizontal and vertical dimensions of the display device.
  • 20. ● ● ● ● ● ● ● Pixesl (picture elements) are tiny dots that form an image on the screen Dot pitch is the amount of space between mizels, measured in milimeters. The smaller the dotpitch the sharper the display. A modem uses a phone line and can transfer data at a speed up to 56,000bps ( bits per second) A digital subscriber line(DSL) connection also uses a standard phone line but it can transfer data 20 time faster than a standard dial up A cable modem uses the cable TV line maintained by the cable company and is generally faster than DSL A network interface card(NIC) is a device that connects a computer to a local area network .
  • 21. ● ● Wireless networking is available in homes businesses and schools. A wireless adapter enables the computer to connect to a local area network and the internet. Computer programs, known as software, are instructions that tell a computer what to do .Computers do not understand human languages so programs must be written in a language a computer can use. All programs must be converted into a language the computer can understand. ● ● Machine Language-a computer's native language – a set of built in primitive instructions These instructions are in the form of binary code.
  • 22. ● ● ● ● ● Assembly language uses a short descriptive word known as a mnemonic to represent each of the machine language instructions. The mnemonic add typically means to add numbers and sub means to subtract the numbers Assembly languages were developed to make programming easier An assembler is a program used to translate assembly language programs into machine code. Assembly language is referred to as a low level language because assembly language is close in nature to machine language and is machine dependent.
  • 23. ● ● ● ● ● ● ● High level languages are platform independent Platform indemendent means that you can write a program in a high level language and run it in different types of machines. Higl level languages are english like and easy to learn and use The instructions in a high level programming language are called statements. A program written n a high level language is called a source program or source code A source program must be translated into machine code for execution. Translation can be done using an interpreter or a compiler
  • 24. ● An interpreter reads one statement from the source code translates it to the machine code or virtual machine code and then executes it right away.
  • 25. Popular Programming Languages Ada ● Named for Ada lovelace, who worded on mechanical general- purpose computers. The Ada language was developed for the Department of Defense and is used mainly in defense projects BASIC ● Beginner's All purpose Symbolic Instruction Code. It was designed to be learned and used easily by beginners.
  • 26. C ● ● Developed at Bell Laboraories. C combines the power of an assembly language with the ease of use and portability of a high level language C++ ● C++ is an object oriented language, based on C C# ● ● Pronounced “C Sharp” it is a hybrid of Java and C++ and was developed by Microsoft. COBOL ● Common Business Oriented Language ● Used for business applications
  • 27. FORTRAN ● ● FORmula TRANslation. Popular for scientific and mathematical applications. Java ● Developed by Sun Microsystems ● Now a part of oracle ● It is widely used for developing platform independent internet applications Pascal ● ● Named for Blaise Pascal who pioneered calculating machines in the seventeenth century It is a simple structured general purpose language primarly for teaching programming
  • 28. Python ● A sinple general purpose scripting language good for writing short programs Visual Basic ● ● Visual Basic was developed by microsoft Enables the programmers to rapidly develop graphical user interfaces
  • 29. ● ● An interpreter translates and executes a program one statement at a time A compiler translates the entire source program into a machine language file for execution The operating system(OS) is the most important program that runs on a computer The OS manages and controls a computer's activities. ● ● ● The popular operating systems for general purpose computers are Microsoft Windows, Mac OS and Linus Application programs cannot run unless and operating system is installed and running on the computer.
  • 30. Major Tasks of an Operating system ● Controlling and monitoring system activities ● Allocating and assigning system resources ● Scheduling operations
  • 31. ● ● ● ● ● ● ● Operating systems perform basic tasks An operating system must also ensure that different programs and users working at the same time do not interfere with each other. The OS is responsible for security, ensuring tht unauthorized users and programs do not access the system. The OS is responsible for determining what computer resources a program needs and for allocating and assigning them to run the program The OS is responsible for scheduling programs' activities to make efficient use of system resources. Multiprogramming allows multiple programs to run simultaneously by sharing the same CPU Multithreading allows a single program to execute multple tasks at the same time
  • 32. ● ● Multiprocessing or parallel processing uses two or more processors together to perform subtasks concurrently and then combine solutions of the subtasks to obtain a solution for the entire task. It is like a surgucal operation where several doctors work together on one patient.
  • 33. Java, the World Wide Web and Beyond Java is a powerful and versatile programming language for developing software running on mobile devices, desktop computers and servers. Java was developed by a team ed by James Gosling at Sun Microsystems. Originally called Oak, Java was designed in 1991 for use in embedded chips in consumer electronic appliances. In 1995 , renamed Java it was redesigned for developing Web applications.
  • 34. ● ● ● ● Java is popular particularly because of its promise that you can write a program once and run it anywhere Java is simple, object oriented, distributed, interpreted, robust, secure, architechure neutral, protable, high performance, multithreaded and dynamic. Java is a full- featured, general- purpose programming language that can be used to develop robust mission- critical applications. Java was used to develop the code to communicate with and control the robotic rover on Mars.
  • 35. ● ● ● ● ● The World Wide Web is an electronic information repository that can be accessed on the Internet from anywhere in the world. The internet has been around for more than forty years. Java became attractive because Java programs can be run from a Web browser. Java programs run in a Web browser are called applets Applets employ a modern graphical interface with buttons, text fields, text areas, radio buttons and more
  • 36. ● ● ● ● ● ● Applets make the Web responsive, interactive, and fun to use Applets are embedded in an HTML file HTML( Hypertext Markup Language) is a simple scripting language for laying out documents, linking documents on the internet and bringing images, sound and video alive on the Web. Java is very popular for developing applications of Web Servers Java is a versatile programming language You can use java to develop applications for desktop computers servers and small hand held devices
  • 37. The software for Android cell phones is developed using Java The Java Language Specification,Api,JDK, and IDE ● Java syntax is defined in the Java language specification, and the Java library is defined in the Java API, The JDK is the software for developing and running Java programs. An IDE is an integrated development environment to rapidly developing programs
  • 38. ● ● ● ● ● Computer languages have strict rules of usage If you do not follow the rules the computer will not be able to understand The Java language specification and the Java API define the Java standards. The Java language specification is a dechnical definition of the Java programming language's syntax and semantcs application program interface ( API) also known as the library contains The predefined classes and interfaces for developing Java programs.
  • 39. Three Editions of Java ● ● ● Java Standard Edition (Java SE) to develop clientside standalone applications or applets Java Enterprise Edition ( Java EE) to develop serverside applications, such as Java servelets, JavaServer Pages (JSP) and JavaServer Faces (JSF) Java Micro Edition ( Java ME) to develop applications for mobile devices. Java SE is the foundation upon which all other Java technology is based. ● The Java Development Toolkit is called JDK
  • 40. ● ● JDK consists of a set of separate programs, each invoked from a command line for developing and testing Java prorams. Java development tools ----NetBeans ----Eclipse ---Textpad ● ● Software that provides and integrated development enviorment ( IDE) for developing Java programs quickly Editing, compiling, building, debugging and online help are integrated in one graphical user interface
  • 41. A simple Java Program A Java program is executed from the main method in the class. ● ● ● Console- an old computer term that refers to the text entry and display device of a computer Console input means to receive input from the keyboard Console output means to display output on the monitor
  • 42. 1 public class Welcome { 2 public static void main ( String [] args) { 3 //Display message Welcome to Java! On the console 4 System.out.println(“Welcome to Java!”); 5 6} }
  • 43. Note the line numbers are for reference purposes only!!!! Line 1 defines a class. ● Every Java program must have at least one class ● Each class has a name ● Class names start with an uppercase letter. ● Out class name in the example is Welcome Line 2 defines the main method ● ● ● The program is executed from the main method A class may contain several methods The main method is the entry point where the program begins execution
  • 44. ● ● ● ● ● ● ● A method is a construct that contains statements The main method in our program contains the System.out.println statement This statements displays the string on the console String is a programming term meaning a sequence of characters A string must be enclosed in double quotation marks Every statement in Java ends with a semicolon(;) known as the statement terminator Reserved words or keywords have a specific meaning to the compiler and cannot be used for other purposes in the program
  • 45. ● ● ● ● ● ● Class compiler understands that the word after class is the name for the class Public, static, and void are also reserved words in Java Line 3 is a comment that documents what the program is and how it is constructed Comments help programmers to communicate and understand the program Comments are ignored by the compiler Comments are preceded by two slashes (//) on a line called a line comment or enclosed between /* and */ on one or several lines
  • 46. ● ● ● ● ● ● ● Block or paragraph comments are on several lines When the compiler sees // it ignors all text after // on the same line When it sees /* it scans for the next / and ignores any text between /* and*/ A pair of curly braces in a program forms a block that groups the program's components. In Java each bock begins with an opening brace ({) and ends with a closing brace (}) Every class has a class block that groups the data and methods of the class. Every method has a method block that groups the statements in a method
  • 47. ● ● ● ● Blocks can be nested meaning that one block can be placed within another An opening brace must be matched by a closing brace Java source programs are case sensitive Main and main do not mean the same thing.
  • 49. ● ● The most common errors made as one learns to program are syntax errors The multiplication operator in Java is *
  • 50. Create, Compiling and Executing a Java Program ● ● ● ● You save a Java program in a .java file and compile it into a .class file. The .class file is executed by the Java Virtual Machine. You have to create your program and compile it before it can be executed. If your program has errors you have to modify it to fix them then recompile it The rourse file must have the same exact name as the public class name
  • 51. ● A java compiler translates a Java source file into a Java bytecode file To compile Welcome.java: javac Weclome.java ● If you have no syntax errors, the compiler generates a bytecode file with a .class extension.
  • 52. ● The java language is a high level language ● Java bytecode is a low level language ● ● ● ● ● Bytecode is similar to machine instructions but is architecture neutral and can run on any platform that has a JVM The virtual machine is a program that interprets Java bytecode Java bytecode can run on a variety of hardware platforms and operating systems Java source code is compiled into Javabytecode and Java bytecode is interpreted by the JVM The JVM executes your code along with the code in the library
  • 53. ● ● ● ● ● ● To extcute a java program is to run the program's bytecode You can execute the bytecode on any platfor with a JVM The JVM translates the individual instructions in the bytecode into the target machine language code one at a time rather than the whole program as a single unit Each step is executed immediately after it is translated. If you execute a file that does not exist a NoCLassDefFoundError will occur If you execute a class file that does not have a main method or you mistyped the main method a NoSuchMethodError will occur
  • 54. ● ● ● The JVM first loads the bytecode of the class to memory using a program called the class loader If your program uses other classes the class loader dynamically loads them just before they are needed After a class is loaded the JVM uses a program called the bytecode verifier to check the validity of the bytecode and to ensure that the bytecode does not violate Java's security restrictions
  • 55. Displaying Text in a Message Dialog Box You can display text in a graphical dialog box ● ● To display text in a message dialog box you need to use the showMessageDialog method in the JOptionPane class JOptionPane is one of the many predefined classes in the java library
  • 56. WelcomeInMessageDialogBox.java 1 /* This application program displays Welcome to Java! 2 * in a message dialog box. 3 */ 4 import javax.swing.JOptionPane; 5 6 public class WelcomeInMessageDialogBox { 7 public static void main(String[] args) { 8 // Display Welcome to Java! In message dialog box 9 JoptionPane.showMessageDialog(null,”Welcome to Java!”): 10} 11}