INTRODUCTION Flashcards
deals about creating objects that contain
both data and functions.
Object-Oriented Programming
popular programming language
Java
Who owned Java?
Oracle
When is Java created?
1995
Java requires a __
main function
Java is enclosed in a __
class
The main function or in Java parlance, the main method,
accepts an array
of arguments.
print a line on java console
System.out.println
strongly-typed programming language, which means that you cannot put or assign or store different types of data together.
Java
Characters, including nonprintable.
char
True or False
boolean
Network packets
byte
Whole numbers
int
Smaller than int
short
Larger than int
long
Numbers with floating points.
float
Larger numbers with floating points.
double
Data should be stored in __
identifier or variable
variable names
- alphanumeric characters
- the dollar sign
- underscore
is java variable case sensitive?
yes
can java variable begin with any digit or numbers?
no
can the variable be in any length?
yes
declaring Java variables
<data_type> <variable_name>
</variable_name></data_type>
___ should be declared first before you can make use of them
variables
if there are more than one variable of the same type, you need to separate the variable names by using a ___
comma (,)
when printing variables, it needs to be enclosed in double quotes
false
used to perform operations on variables and values.
operators
data types, and are enclosed in single quotes.
Characters
To separate string literals from values of identifiers, use the + operator, which is also known as a
concatenation operator
predefined functions from a library that is readily available.
scanf or cin from C/C++
simply a way to put together a group of related classes and Java has quite a number of packages for your use.
Packages in Java
magic word to import the packages
import
what can be found in java.util package?
Scanner
Reads an int value
nextInt()
Reads a float value
nextFloat()
Reads a double value
nextDouble()
Reads a short value
nextShort()
Reads a long value
nextLong()
Reads a byte value
nextByte()
Reads a boolean value
nextBoolean()
Reads a string value
nextLine()