Showing posts with label long. Show all posts
Showing posts with label long. Show all posts

All in One

I'm in the middle of creating a program [Java] with the help of two other pals I got in school. We will actually defend that program within this week. We are required to use four out of the five statements, namely:

  • If statement (which includes the Dangling If's and others)
  • Arrays (Whether the normal array or the 2D)
  • Switch (commonly known as Case)
  • Loop (any of the loops)
So array is divided into two which means we have the power to choose which array to use, and that makes it four.

I'll post the code as soon as we are able to merge our codes. Further discussions would be available regarding the program.

Primitive Data Types

Before we'll proceed to programming, I'll start off by introducing you the eight different primitive data types in Java.

BYTE

  •  useful for saving a memory in huge arrays. Sometimes, it can be replaced by an Int (or Integer)

SHORT

  • from the word itself, it means short, or small amount of numbers

LONG

  • an opposite of short, it stores large amount of numbers (ex. 1234566789003252)

DOUBLE

  • this data type goes for decimal number (just like float)
INT
  • the most common data type where double, long, short, and byte can be stored in substitute with some differences to their types (like int can't hold decimal numbers)
BOOLEAN
  • answers only true or false, or simply, yes or no
CHAR
  • single letters are called characters
  • example: 'A ' is a character "AB" is a string

Note: Notice that characters are placed with an open and close single quotation marks while strings are placed with an open and close double quotation marks.

Extended Search

Custom Search
Hello World