Module 1 Flashcards
In this module, you will understand the basics of Java and learn how to create simple programs. Specifically, Define Basic Terminologies Compare Procedural and Object-Oriented Programming Describe the Features of the Java programming Language Analyze a Java Application that Produces Console Output Compile a Java class and Correct Syntax Errors Run a Java Application and Correct Logic Errors
is a list of instructions that tell a computer what to do.
Computer Program
also referred to as machine code and is the most basic set of instructions that a computer can execute.
Machine language
Machine learning _________ programming language
Low-level
Machine learning has the most basic circuitry-level language
(True or False)
true
Machine learning is comprised of binary digits
True or False
True
Machine learning is comprised of ______ digits
Binary
What code is : 00010010010001010010010
01110110010101101001…..
Machine code
includes the physical parts of a computer such as a keyboard and monitor
Hardware
Software are programs and is divided into two:
application software and system software
is any program designed for end-users that performs a specific task that includes word processors, database programs.
application software
a program that is designed to run a computer’s hardware and application programs.
system software
defines the exact order of instructions needed to produce desired results.
Software Logic
the system that uses 1s and 0s to represent the on-and-off circuitry of computer systems.
Binary Numbering System
corresponds closely to a computer processor’s circuitry (0s and 1s) are used to write programs that relate to the specific architecture and hardware of a particular type of computer.
Low-level Programming Language
difficult to use and must be customized for every type of machine on which a program runs.
Low-level Programming Language
allows programmers to write instructions in a language that is easier to understand than low-level languages.
High-level Programming Language
Allows you to use a vocabulary of reasonable terms
High-level Programming Language
Enables development of a programming contest and is generally independent of the computer’s hardware architecture
High-level Programming Language
High-level Programming Language is embedded in the central processing unit
(True or false)
true
o A specific set or rules for the language
o Rules of language: rules that define the structure
o It’s like the grammar in English
Syntax
Control the structure of symbols, punctuation, and words of a programing language
Syntax
Without ______, the meaning or semantics of a language is nearly impossible to understand.
Syntax
o Similar to English sentences
o Commands to carry out program tasks
Program statements
A program written in such a language is form by a sequence of one or more statements
Program statements
A statement may have internal components (e.g. Expressions)
Program statements
Translates language statements into machine code
Compiler or interpreter
Misuse of language rules
Syntax error
A misspelled programming language word
Syntax error
Mistakes in the source code, such as spelling and punctuation errors, incorrect labels, and so on, cause an error message to be generated by the computer
Syntax error
freeing program of all errors
Debugging
Also called semantic errors
Logic errors
Incorrect order or procedure
Logic errors
The program may run but provide inaccurate output
Logic errors
Occur when there is a fault in the logic or structure of the problem
Logic errors
Do not usually cause a program to crash. However, it can cause a program to produce unexpected results
Logic errors
used for linesss (comments)
/* and */
is used for one line (comments)
//
A _______ comment begins with /* and ends with */, and may span multiple lines.
multi-line
An _________________ comment begins with // and lasts till the end of the current line
end-of-line (single-line)
Comments are executable statements and are ignored by the computer
(True or false)
False (Comments are NOT executable statements and are ignored by the computer ) hindi tinatanggap
Comments provide useful explanation and documentation
True or false
True
what is the symbol of braces of block
{ }
This group of statements is treated as one single unit
Block
Is a group of programming statements enclosed by a pair of braces { }
Block
Freeing program of all errors
Debugging
Translates language statements into machine code
Compiler or interpreter
Sets of operations executed in sequence
Procedural programming
Named computer memory locations that hold values
Variables
Individual operations grouped into logical units
Procedures
Is an extension of procedural programming in which you take a slightly different approach to write computer programs
Object-oriented programs
Object oriented programs can create:
classes
objects from classes
applications
Object-oriented programming differs from traditional procedural programming
(true or false)
true
is a feature of the object-oriented programming language, Java, which allows a single task to be performed in different ways.
Polymorphism (Code Reusability)
Is the process of extending the existing code functionality for removing the repetitive coding work
Inheritance
Concerned with the relationship between classes and method, which is like a parent and a child
Inheritance
Allows you to create class hierarchies, where a base class gives its behavior and attributes to a derived class
Inheritance
Refers to the bundling of data, along with the methods that operate on that data
Encapsulation
what are the object-oriented programming concepts
- object
- class
- inheritance
- encapsulation
- abstraction
- polymorphism
programming style where implementation details are hidden
Encapsulation
is also known as data-hidden
Encapsulation
General purpose language
java
is an object-oriented programming language created by James Gosling from Sun Microsystems (Sun) in 1991.
java
The target of ____is to write a program once and then run this program on multiple operating systems (architecturally neutral).
java
Does not execute instructions on the computer directly
java
java runs on a hypothetical computer known as ___________
Java Virtual Machine (JVM)
what is JVM
Java Virtual Machine
Java’s Programming statements (source code) are written in _____-level programming language
high
An object-oriented language for general-purpose business applications and for interactive, Worldwide web-based internet applications
Java
Programming statements written in a high-level programming language
Source code
A set of tools used to write programs
Development environment
Statements saved in a file
Bytecode
A binary program into which the Java compiler converts source code
Bytecode
Checks bytecode and communicates with the operating system
Java interpreter
Executes bytecode instructions line by line within the Java Virtual Machine
Java interpreter
javac unrecognized command
Compilation outcomes
Program language error messages
Compilation outcomes
No messages indicating successful completion
Compilation outcomes
reasons for error messages: 4
- misspelled command
- misspelled filename
- not within correct subfolder or subdirectory on command line
- java not installed properly
Will appear in output exactly as entered
Literal string
Written between double quotation marks
Literal string
Pieces of information passed to a method
Arguments
Requires information to perform its task
Method
Refers to the standard output device for a system
system class
o A reserved keyword o Means the method is accessible and usable even though no objects of the class exis
static
o Use in the main method header
o Does not indicate the main method is empty
void
o Indicates the main() method does not return a value when called
o Does not mean that main() doesn’t produce output
void