Strings are used for storing text. A String variable contains a collection of characters surrounded by double quotes: String greeting = "Hello"; A String in Java is actually an object, which contain methods that can perform certain operations on strings. For example, the length of a string can be found with the length() method: String txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; System.out.println("The … Continue reading Java Series Part 4 – Strings & String Concatenation
Tag: java blog
Java Series Part 3 – Variable/Data Types
Primitive Data Types Data types that can store integer values: int i;byte b;short s;long l; Variable types: byte b = 5; //8bits - 128 to 127short s = 128 //16bits - 32,768 to 32,767int i = 40000; //32 bits - 2,147,483,648 to 2,147,483,647long l = 222222222; //64bits -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807float f = 4.0f; //32 bits … Continue reading Java Series Part 3 – Variable/Data Types