Java Programming: Data Types and Operators-Oracle Academy 4.3

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

short

A Java primitive data type (2 bytes) that holds integer numbers within a shorter range than an int

Declaration

A Java statement when a variable is defined but not necessarily assigned a value. Example: int x

Truncation

A concept where a number is always rounded down to the nearest integer.

char

A java primitive data type (2 bytes) that can hold single character values. Example: "a", "#", or "X"

boolean

A one-bit java primitive type that can hold the value true or false.

+

Addition Operator

literal

Can be any number, text, or other information that represents a value; used to initialize a primitive type.

==

Comparison Operator: Equal to

>

Comparison Operator: Greater Than

--

Decrement Operator--Subtracts 1

/

Division Operator-Finds the Quotient

++

Increment Operator--Adds 1

*

Multiplication Operator

Variables

Named primitive or object storage mechanisms defined in a program. The assigned value may or may not (constants) change.

x++

Post-increment Notation

++x

Pre-increment Notation

Arithmetic Operators

Symbols are used to do addition, subtraction, multiplication, division, and modular arithmetic in math expressions and formulas.

%

Division Operator-Finds the Remainder

-

Subtraction Operator

Initialization

When a variable is assigned a value for the first time

=

Assignment Operator-Sets to a value

>=

Comparison Operator: Greater Than or Equal To

<

Comparison Operator: Less Than

<=

Comparison Operator: Less than or Equal to

!

Comparison Operator: Not

!=

Comparison Operator: Not Equal To

Assignment Operator

The equals sign "=" used in a Java statement to assign a value to a variable.

Conventions

The formatting and naming standards that most programmers follow

Primitive Data Types

The group of Java data types that do not use the keyword new when declared or initialized. Primitive Data Types store the value in the same place in memory as the variable name.

Type Casting

The process of explicitly modifying one data type to become a different data type.

Type Conversion

The process of modifying one data type to become a different data type, this may be implicit or explicit.

byte

The smallest java primitive type (1 byte) that can hold an integer value.

float

This Java primitive data type (4 bytes) can be initialized with a decimal number preceding letter f. Example: float x = 3.5f;

int

This Java primitive data type (4 bytes) can hold integer values.

double

This Java primitive data type (8 bytes) is the largest primitive that can hold a decimal value.

long

This data type (8 bytes) is the largest integer type.

Scope

Used to describe the block of code where a variable exists in a program. A block of code is denoted by {}.


संबंधित स्टडी सेट्स

Fundamentals of Sleep Technology (Exam 1 Study Guide)

View Set

Anatomy and Physiology Test 2: FINAL

View Set

Temperate Fruits: apples, pears, peaches, and pomegranates (2)

View Set