ODNYX.
Tutorials
Java
CSS
Database
DevOps
Spring
Design Patterns
References
Subscribe
Java
CSS
Database
DevOps
Spring
Design Patterns
Java Syntax and Variables — Quick Check
1. Which of these is a valid way to declare an integer variable in Java?
var age = 25
int age = 25;
age: int = 25
let age = 25;
2. What does it mean that Java is 'statically typed'?
Variables can change type at runtime
Every variable's type is fixed and checked by the compiler
Variables must be declared using the `static` keyword
Types are optional and inferred at runtime
Check answers
❮ Home
Next: Java Foundations Interview Questions ❯