admin

admin

More Data Types and Operators

Arrays One-Dimensional Arrays Multi-Dimensional Array Jagged Array The array created by this program looks like this:  Alternative Array Declaration Syntax Assigning Array References Using the length Member The foreach Style For Loop String String Declarations There are two ways to…

Introducing Class, Object and Methods

Class Fundamentals class classname { type instance-variable1; type instance-variable2; // … type instance-variableN;  type methodname1(parameter-list) { // body of method }  type methodname2(parameter-list) { // body of method }  // …  type methodnameN(parameter-list) { // body of method } }  Here is a class called Box that defines three instance variables: width, height, and depth.…

Program Control Statements

Decision Constructs Java supports two selection statements: if and switch. These statements allow you to control the flow of your program’s execution based upon conditions known only during run time.  The if-else Statement The if statement is Java’s conditional branch statement. It…