[CT4101]: Add Topic 2 Examples

This commit is contained in:
2024-09-29 06:45:09 +01:00
parent 90824b5e03
commit 7a1f9943fc
8 changed files with 586 additions and 0 deletions

View File

@ -0,0 +1,9 @@
public class staticvsdynamic1 {
public static void main(String[] args) {
int x = 4; // compiles ok
x = 5; // compiles ok
x = 3.14159; // compiler error
x = "Hello world!"; // compiler error
y = "abc123"; // compiler error
}
}