- Chapter 1 : Introduction and installation
- Chapter 2 : What Java is and how it works ?
- Chapter 3 : Getting a job and what to study after completing ?
- Chapter 4 : How to get The most out of this course
- Chapter 5 : A Hello World program
- Chapter 6 : Using variables
- Chapter 7 : Strings: working with text
- Chapter 8 : While loops
- Chapter 9 : For loops
These notes are based on the Oracle Java SE Tutorial.
Notes on this chapter are based on Variables and Primitive_Data_Types Java SE Tutorial.
- Java defines the following kinds of variables:
Instance variablesClass variablesLocal variablesParameters
- Uses the Camel Case convention for naming Java variables except for the ones storing constant value, where we use Screaming Snake Case convention.
- Java supports eight (08) primitive data types :
byte: an 8-bit signed two's complement integershort: an 16-bit signed two's complement integerint: an 32-bit signed two's complement integerlong: an 64-bit signed two's complement integerfloat: a single-precision 32-bit IEEE 754 floating point; should never be used for precise values, such as currencydouble: a single-precision 64-bit IEEE 754 floating point; generally the default choice for decimal values; should never be used for precise values, such as currencyboolean: has only two possible values : true and falsechar: a single 16-bit Unicode character
- Special escape sequences for
charare:\b(backspace)\t(tab)\n(line feed)\f(form feed)\r(carriage return)\"(double quote)\'(single quote)\\(backslash)
Notes on this chapter are based on Strings Java SE Tutorial.
Stringclass has 13 constructors, allowing to provide the initial value of the string using different sources.Stringobjects are immutable, which means that once created, their values cannot be changed.- List of some
Stringmethods signature :- public int
length() - public char
charAt(int index) - public String
concat(String str)
- public int
- The
+operator is the most used for concatenation. And such a concatenation can be mixture of any objects. So, for each object that is not aString, itstoString() method is called to convert it to aString.