Java Programming

By ShinkokuEndo

2K 15 10

https://docs.oracle.com/javase/tutorial/ This is the link where I learned my java lessons online. I choose ja... More

Hello World
Introduction to OOP
Variables
Primitive Data Types
Operators
Equality, Relational and Conditonal Operators
Bitwise and Bitshift operators
Expression, Statements and blocks
Control Flow Statement
Break, continue and return
Class Declaration
Objects
return
this
Modifiers
static
Nested classes
Local classes
Anonymous class
Lambda class
Lambda
Syntax of Lambda
Method Reference
Enum
Annotations
Interfaces
Inheritance
Casting Objects
Overriding Methods
Overriding in Interface Methods
Polymorphism and some notes
Abstract class
Number
Formatting Strings
DecimalFormat class
StringBuilder class
Generics
Bounded Type Generics
Generics more info
Package
Exception
throw
Byte streams
Character Stream
Buffered Streams
Scanner
formatting
Console
Data Streams
Object stream
Path
Other things to know before moving to file class
Checking a file
Deleting, Copying And Moving Files
File Metadata
Reading, writing and creating files
Creating file and temp file
Directories
Walking the file tree
Note

Arrays

83 0 0
By ShinkokuEndo

Arrays is like creating a variable but in multiple times.

=================================
creating a variable
int x = 1;

creating an array of 5 integers
int[] x = new int(5);
x[0] = 100;
x[1] = 200;
x[2] = 300;
x[3] = 400;
x[4] = 500;

≈===============================

1. First, we declared an array of integers to create 5 variables.

2  Next, we initialize each variable with a integer value.

Note:
All arrays start with index zero. That is why the first element is x[0]. So, the last element is n - 1 index. In the example, x[5 - 1].

In this example, we tried to initialize each element of the array one by one but in reality,  you can just used a loop like for loop which will be discuss later.

Another way to create an array is by combining the declaration and initialization.

===============================

int[] x = {100, 200, 300, 400, 500};

===============================

You can also create a multi dimensional array.

Two dimensions
============================≈=

int[][] x = {{1000, 2000, 3000}, {5000}};

=============================
Equivalent in array indexes

x[0][0] = 1000
x[1][0] = 2000
x[2][0] = 3000
x[0][1] = 5000

In math, using two dimensions in graph we usually used x and y.

variable[x][y]

Note:
Java has prepared several methods in the built in library. These methods and properties are usually the common ones we used in the program. Like for example the length, sorting, copying, converting to string and etc which can be found in java.util.Arrays class.

=========================≈=
System.out.println(x.length);
============================
Result:
5

Continue Reading

You'll Also Like

17.4K 242 9
*เณƒเผ„"๐•‹โ„๐”ผโ„๐”ผ'๐•Š โ„•๐•† โ„™๐•ƒ๐”ธโ„‚๐”ผ ๐•ƒ๐•€๐•‚๐”ผ โ„๐•†๐•„๐”ผ"โ‹†.เณƒเฟ”*:๏ฝฅ หš เผ˜โ™ก โ‹†๏ฝกหš. ๐’ฒ๐ป๐ธ๐‘…๐ธ ๐’œ ๐’ฎ๐ป๐’ช๐‘…๐’ฏ ๐’ข๐ผ๐‘…๐ฟ ๐’ฒ๐ผ๐’ฏ๐ป ๐ผ๐’ฎ๐’ฎ๐’ฐ๐ธ๐’ฎ ๐ผ๐’ฉ ๐’ฏ๐ป๐ผ๐’ฎ ๐‘…๐ธ๐’œ๐ฟ๐ผ๐’ฏ๐’ด...
655 5 35
I am just documenting things what i learned online in here. I do express things in my own words. And I create my own program samples which serves as...
457 0 30
Get ready to embark on a fun and inspiring journey of self-discovery that invites you to think differently, live more intentionally, and take action...
199K 12.1K 111
*A WATTPAD FEATURED GUIDE* *Highest Ranking #5 in Non-Fiction's HOT List* *Ranked #1 in #how-to, #1 in #editor, #1 in #publishing, and #1 in #grammar...
Wattpad App - Unlock exclusive features