INTRODUCTION TO JAVA Flashcards
Who created Java and when?
Creator: James Gosling
From: Sun Microsystems Inc
Year: 1995
Later Acquired BY: Oracle Corporation
a class-based, object-oriented programming language and is designed to have as few implementation dependencies as possible.
JAVA
Syntax of Java is similar to:
C/ C++
What is the meaning of the slogan WORA
Write Once Run Anywhere
Why is Java called Java?
Named after the island where the first coffee was produced, Java Coffee
ensures the same Java code can be run on different operating systems and platforms.
Java Virtual Machine
Reasons to use Java
- Easy to Learn
- Simple to use
- Open source / FREE
- Popular
- Similar syntax with C and C++
- Allows code to be reused, LOWERS Development COSTS
is required and you will see it in every Java
program:
Main Method
method to print a line of text to the screen.
Print Method
println();
All Java variables must
be identified with unique names
called:
Identifiers
Give me examples of primitive data type
byte
short
int
long
float
double
boolean
char
Give me examples of non primitive data type
String
Arrays
Classes
Interface
and more…
data types are called reference types because they refer to objects
Non primitive
These are used to perform common mathematical operations
Arithmetic Operators
These are used to assign values to variables
Assignment Operators
These are used to compare two values (or variables). The return value is true or false.
Comparison Operators
These are used to determine the logic between variables or values.
Logical Operators
These are used to perform operations on individual bits of the operands. They are useful for low-level
programming, such as manipulating bits in memory, encryption, compression, etc.
Bitwise Operators
This class is part of the java.util package in
Java and is used for reading input from different sources, such
as the keyboard.
java.util.Scanner;
Cannot be used for a variable name in java
Keywords (Reserved Words)
is an object associated with the standard
input device.
System.in object
Scanner method used to read a string value form the user is:
next()
There is also a short-hand if else, which is known as the _______ because it consists of three operands.
ternary
operator
loop inside another loop.
nested loop