CSE2005 - Full Java Solutions &
Explanations
CSE2005: Object Oriented Programming - Full Topic-Wise Solutions,
Syntax, and Concepts
------------------------------------------------------------
1. **Basics of Java**
**Conceptual Overview**
- **Java Syntax**: Structure of Java programs (class, main method).
- **Data Types**: int, float, double, boolean, char, String.
- **Input/Output**: Scanner for input, [Link] for output.
- **Operators**: Arithmetic, Relational, Logical, Assignment.
- **Control Statements**: if-else, switch-case, loops (for, while, do-while).
**Syntax Reference**
// Basic class and main method
public class Main {
public static void main(String[] args) {
// code here
}
}
// Taking input
Scanner sc = new Scanner([Link]);
int num = [Link]();
String name = [Link]();
// Conditional
if (a > b) {
[Link]("A is greater");
} else {
[Link]("B is greater");
}
// Loop
for (int i = 0; i < 5; i++) {
[Link](i);
}