JAVA: basics

Aditi Dosi
Sep 24, 2022

--

By: Aditi Dosi

Hello, World.

Editing, compiling, and executing:

Built-in data types:

Declaration and assignment statements:

Integers:

Floating-point numbers:

Booleans:

Comparison operators:

Printing:

Parsing command-line arguments:

Math library:

The full java.lang.Math API.

Anatomy of an if statement:

If and if-else statements:

Nested if-else statement:

Anatomy of a while loop:

Anatomy of a for loop:

Loops:

Break statement:

Do-while loop:

Switch statement:

Arrays:

Inline array initialization-

Typical array-processing code-

Two-dimensional arrays:

Our stack data type:

Our queue data type:

Iterable:

Our symbol table data type.

Our set data type:

Our graph data type:

(wait for java series part 2…)

Thankyou :)

--

--