Introduction to Computers and Java

Ace your homework & exams now with Quizwiz!

Just-In-Time (JIT compiler)

most java programs today are executed using this compiler in which byte-code is compiled as needed and stored for later reuse without needing to be re-compiled.

System.out

object for sending output to the screen

What does a class name start with?

capital letter

object-programs

compilers produce machine- or assembly-language program called obj programs.

byte

consists of 8 bits. Each byte in main memory resides at a numbered location called its address.

IDE (integrated development environment)

Used to combine a text editor with commands for compiling and running Java programs.

What must be done before compiling a program?

a Java program consists of 1+ classes, which must be compiled before running the program.

Compiler

a compiler translates a program from a high-level language to a low-level language the computer can run

bit

a digit with a value of either 0 or 1

Source program

a high-level-language program version that you run the compiler on to compile the program.

Classes

a java program consists of several pieces called classes. Ea class may have a different author and ea is compiled separately into byte-code. A class is a piece of program in Java.

package (specific to Java)

a library of classes that have been defined already. A shared program provided by someone that you will use.

programmer

a person who writes a program

interpreter

a program that translates each byte-code instruction, executing the resulting machine-language instructions on the particular computer before translating the next byte-code instruction.

programs

a set of instructions for a computer to follow

Methods

actions

bug

an error in a program

Statement

an instruction to the computer; ends in a semicolon

class-loader

automatically connects the classes together

Compiling, interpreting, running

1) use the compiler to translate the Java program into byte-code (using the Javac command). 2) use Java virtual machine for your computer to translate ea. byte-code instructions into machine language and to run the resulting machine-language instructions (using Java command).

Inheritance

A way to organize classes. A class at lower levels inherits all the characteristics of classes above it in hierarchy. At ea level, classifications become more specialized by adding other characteristics. Higher classes are more inclusive and lower classes are less inclusive.

What is encapsulation aka?

AKA information hiding because it provides a means of using the class, but it omits the details of how the class works.

Why is Java suitable for internet applications?

After compiling a java program into byte-code, that byte-code could be used on any computer with a byte code interpreter and without a need to recompile. After this, the byte-code can be send over the internet and can be used anywhere in the world.

What is another name for the processor?

CPU (central processing unit) or the chip

How is data stored?

Data of all kinds are encoded and stored using 1s and 0s. When more than a single byte is needed, several adjacent bytes are used. The address of the 1st byte is the address of the unit of bytes.

What three primary design principles does OOP adhere to?

Encapsulation, polymorphism, and inheritance

How are files organized?

Files are organized into groups called directories of folders.

Polymorphism

From Greek meaning "many forms." A method name (used as instruction), produces results that depend on the class of the object that used the method.

Syntax errors

Grammatical mistakes in a program

What are files?

Large groups of bytes in auxiliary memory where java programs are stored.

What does memory hold?

Programs, data for the computer to process and the results of intermediate processing.

What are the three kinds of errors?

Syntax errors, runtime errors, and logic errors.

Encapsulation

The data and methods associated with any particular class are encapsulated (put together in a capsule), but only part of the contents is made accessible.

Algorithms

describes a means of performing an action. A set of instructions for solving a problem. usually expressed in English or pseudocode.

Ex. of auxiliary memory

disk drives, cds, dvds, flash drives

Java compiler

does not translate a Java program into assembly language or machine language for a particular computer, instead it translates a Java program into byte-code.

debugging

eliminating errors

Runtime errors

errors detected when the program is running but not during compilation. terminates after detecting error.

Logic errors

errors not detected during compiling or running but cause program to produce incorrect answers.

running/executing

following the instructions is called running or executing the program.

Scanner

gets the user input from keyboard

What is auxiliary memory usually measured in?

gigabytes

what are the components of the modern computer?

input devices (ex. keyboard, mouse) and output devices (ex. display screen, printer) and a processor and two kinds of memory.

what are the two kinds of memory?

main memory and auxiliary memory

What is main memory usually measured in?

megabytes

println

method to print whatever is in parentheses to the user

The Processor

processes a program`s instructions

where are program files copied from?

program files are copied from auxiliary memory to main memory in order to be run.

Software

programs - sets of instructions for the computer to follow.

RAM (Main memory)

random access memory. A byte is a quantity of memory.

what is auxiliary memory aka?

secondary memory. Auxiliary memory is permanent

Variable

something that can store data.

where does the processors power of computing come from?

speed and program intricacy

What happens to the byte-code version of the program after the Java program is compiled?

the byte-code version of the program has the same name but the ending is changed from .java (source file) to .class

What is the main memory used to store?

the current program, the data the program is using, and the results of intermediate calculations.

Syntax of a language

the grammar rules for a programming language

Argument(s)

the item(s) inside parenthesis that provide the information needed by methods.

operating system

the operating system is a supervisory program that oversees the operation of the computer. The operating system retrieves and starts program for you (ex. Microsoft Windows, Linux).

What is the output?

the output is the result produced by following the instructions in the program

user

the person who interacts w/the program

What are two kinds of input the computer receives?

the program and the data needed by the program.

Hardware

the tangible parts of computer systems

What do objects in the same class have in common?

they have a common set of methods and the same kinds of data. but ea obj can have its own data values.

What does objects of the same kind have in common?

they have the same type and belong to the same class.

Object-oriented programming (OOP)

treats a program as a collection of objects that interact by means of actions.

how do you compile a program?

you compile a program by running the compiler on the high-level-language version of the program called the source program.


Related study sets

8.3 Test Review; Cellular Respiration and Photosynthesis

View Set

Cross Sectional Anatomy: Application Questions- Ch. 2 and Ch. 5

View Set

Income Statement, Retained Earnings, or Balance Sheet?

View Set

Chapter 6 Customer Driven Marketing Strategy: Creating Value for Target Customers

View Set

Topic 11 Cardiovascular System (Blood)

View Set

Prakarya, Wirausaha budi daya unggas, III

View Set