Java - Programming Language
This course covers the basics of programming in Java. Work your way through the videos/articles and I'll teach you everything you need to know to start your programming journey!

Data Types

Lesson 6
Author : 🦒
Last Updated : October, 2017


byte age0 = 0; // 8-bit signed two's complement integer short age1 = 10; // 16-bit signed two's complement integer. int age2 = 20; // 32-bit signed two's complement integer long age3 = 30L; // 64-bit optionally signed two's complement integer

float gpa0 = 2.5f; // 32-bit floating point double gpa1 = 3.5; // double-precision 64-bit floating point

boolean isTall; // 1 bit -> true/false isTall = true;

name = "John";

System.out.println("Your name is " + name); System.out.printf("Your name is %s \n", name); /* %f -> double or float %d -> Integer %s -> string %c -> character %b -> boolean */