Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

1. Introduction to Java Programming

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

1. Introduction to Java Programming

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

8/15/24, 9:35 PM Chapter Summary - Introduction to Java Programming

CHAPTER 1 SUMMARY

INTRODUCTION TO COMPUTERS,
PROGRAMS AND JAVA

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

A computer includes both hardware and software.

Hardware is the physical aspect of the computer that can be touched.

Computer programs, known as software, are the invisible instructions


that control the hardware and make it perform tasks.

Computer programming is the writing of instructions (i.e., code) for


computers to perform.

The central processing unit (CPU) is a computer’s brain. It retrieves


instructions from memory and executes them.

Computers use zeros and ones because digital devices have two stable
states, referred to by convention as zero and one.

A bit is a binary digit 0 or 1.

A byte is a sequence of 8 bits.

A kilobyte is about 1,000 bytes, a megabyte about 1 million bytes, a


gigabyte about 1 billion bytes, and a terabyte about 1,000 gigabytes.

Memory stores data and program instructions for the CPU to execute.

A memory unit is an ordered sequence of bytes.

localhost:63342/2024_07_PG1_sevvalyurtseven/src/summary/chapter1/chapter1Summary.html?_ijt=q63m4k9el826sfu8a7j6vspcg&_ij_reload=RELOAD_ON_… 1/3
8/15/24, 9:35 PM Chapter Summary - Introduction to Java Programming

Memory is volatile, because information is lost when the power is turned off.

Programs and data are permanently stored on storage devices and are
moved to memory when the computer actually uses them.

The machine language is a set of primitive instructions built into every


computer.

Assembly language is a low-level programming language in which a


mnemonic is used to represent each machine-language instruction.

High-level languages are English-like and easy to learn and program.

A program written in a high-level language is called a source program.

A compiler is a software program that translates the source program into a


machine-language program.

The operating system (OS) is a program that manages and controls a


computer’s activities.

Java is platform independent, meaning that you can write a program


once and run it on any computer.

Java programs can be embedded in HTML pages and downloaded by Web


browsers to bring live animation and interaction to Web clients.

The Java source file name must match the public class name in the
program. Java source code files must end with the .java extension.

Every class is compiled into a separate bytecode file that has the same
name as the class and ends with the .class extension.

To compile a Java source-code file from the command line, use the javac
command.

To run a Java class from the command line, use the java command.

localhost:63342/2024_07_PG1_sevvalyurtseven/src/summary/chapter1/chapter1Summary.html?_ijt=q63m4k9el826sfu8a7j6vspcg&_ij_reload=RELOAD_ON_… 2/3
8/15/24, 9:35 PM Chapter Summary - Introduction to Java Programming

Every Java program is a set of class definitions. The keyword class


introduces a class definition. The contents of the class are included in a block.

A block begins with an opening brace ({) and ends with a closing brace (}).

Methods are contained in a class. To run a Java program, the program


must have a main method. The main method is the entry point where the
program starts when it is executed.

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.

In Java, comments are preceded by two slashes (//) on a line, called a line
comment, or enclosed between /* and */ on one or several lines, called a
block comment or paragraph comment. Comments are ignored by the
compiler.

Java source programs are case sensitive.

Programming errors can be categorized into three types: syntax errors,


runtime errors, and logic errors. Errors reported by a compiler are called
syntax errors or compile errors. Runtime errors are errors that cause a
program to terminate abnormally. Logic errors occur when a program does
not perform the way it was intended to.

localhost:63342/2024_07_PG1_sevvalyurtseven/src/summary/chapter1/chapter1Summary.html?_ijt=q63m4k9el826sfu8a7j6vspcg&_ij_reload=RELOAD_ON_… 3/3

You might also like