Searching for Core Java and SQL free Online Course? To be a strong developer, start learning free online Java Courses and SQL tutorials that are excellent for beginners. Visit us @ https://www.brainsmartlabs.com/
3. Welcome!!
We are providing the best Java and SQL
tutorial videos for beginners who want to
learn Java in detail. Here we are
explained data types which is a part of
java course. Kindly visit our website and
watch our videos for more info @
https://www.brainsmartlabs.com/
4. What is data type?
In computer programming, a data type is an attribute of data which
indicates the compiler or interpreter how the programmer expects
to use the data.
There are three types:
1. Primitive types byte, short, int, long, float, double, char
2. Derived types Arrays
3. User-defined types class, sub class, abstract class, interface,
enumeration and annotation.
5. Primitive Data Types
Primitive data types
Numeric Types Non-Numeric Types
Integer Types
(Whole numbers)
Floating Point Types
(Decimal numbers)
• Byte – 8 bit
• short – 16 bit
• int – 32 bit
• long – 64 bit
• float – 32 bit
• double – 64 bit
Char
8bit
Boolean
True - or- false
6. Numeric Types
The numeric types has divided into two types.
Integer types: Positive, negative, Whole numbers and without decimal
Floating point types: With decimal, numbers with fractional part
7. Integer Types
Byte: The byte is an 8-bit signed two's complement integer. It has a minimum
value of -128 and a maximum value of 127.
For Example:
byte myNum = 120;
System.out.println(myNum);
Short: It can store whole numbers from -32768 to 32767.
For Example:
short myNum = 5002;
System.out.println(myNum);
8. Integer Types
int: It can store whole numbers from -2147483648 to 2147483647.
For Example:
int myNum = 200000;
System.out.println(myNum);
long: The long data type can store whole numbers from -9223372036854775
808 to 9223372036854775808.
For Example:
long myNum = 20000000000L;
System.out.println(myNum);
9. Floating Point Types
float: It can store fractional numbers from 3.4e−038 to 3.4e+038. Should end
with “f”.
For Example:
float myNum = 3.75f;
System.out.println(myNum);
Double: The double data type can store fractional numbers from 1.7e−308 to
1.7e+038. Should end with “d”.
For Example:
double myNum = 17.99d;
System.out.println(myNum);
10. Non Primitive DataTypes
Booleans: A Boolean data type is declared with the boolean keyword. It only t
akes the values true or false.
For Example:
boolean iscat = true;
boolean isFish = false;
System.out.println(iscat);
System.out.println(isFishTasty);
11. Non Primitive Data Types
char: It is used to store a single character. A char value must be enclosed by
single quotes, like 'A' or 'B'.
For Example:
char myGrade = 'C';
System.out.println(myGrade);
12. Who we are?
Brainsmartlabs.com is one of the best online platform where easily can learn Java
and SQL courses online for free. Here you will learn the free basics first and then
get into the core subject of Java and SQL language. Brain Smart Labs is
one such platform which makes learning easier and affordable with n number of
videos for free and paid. Our videos will not make you bored as our trainer follows
a unique way of teaching with tasks, DIY, tricky questions for each and very videos.
Also, SQL and Java beginners can start their tutorials from the basic with free
videos. You can easily start your advanced SQL tutorial with examples with us.