Oct 6, 2024
int a = 5;
// Integerchar b = 'A';
// Characterlong
, double
(other numeric types)String name = "Susan";
.
) to access methods of an object.
name.toUpperCase();
public static void addExclamation(String s) { ... }
return
for methods that output a value.Animal
class with a method IAmDog()
.Animal a = new Animal();
.a.methodName();
.if (condition) { ... }
else if
and else
.for (initialization; condition; increment) { ... }
while (condition) { ... }
try { ... } catch (Exception e) { ... }