As mentioned before, Java is a C-based language and much of the basic syntax is the same. Both languages allow you to indent statements any way you like. Indentation is largely used to make code more readable. Both languages end statements with a semicolon. Braces are used to delimit blocks of code. The mathematical, relational, assignment, and boolean operators are the same in Java and C. In addition to mathematical addition, Java uses the + operator to concatenate strings. Java does not use the address operator ( & ), dereference ( * ), or struct access ( -> ) operators because it does not support publicly accessible pointers. Java and C use the same types of loop and flow control structures including if-else , while , do-while , for , and switch statements. Java also has the transfer of control statements return , break , and continue . |