Comprehensive ICSE Class 10 Computer Notes
Comprehensive ICSE Class 10 Computer Notes
- **Principles of OOP**:
- **Class**: A blueprint for objects, containing data and methods. Example: `class Student`.
2. Introduction to Java:
- **Data Types**: Primitive (int, float, char) vs. Non-primitive (String, arrays).
- **Arithmetic Operators**: +, -, *, /, %.
6. Input in Java:
- Methods include:
- `Math.abs(-5)` returns 5.
- `Math.sqrt(16)` returns 4.
8. Conditional Statements:
- **If-else**: Example:
```java
if (a > b) {
System.out.println("A is greater");
} else {
System.out.println("B is greater");
```
- **Switch-case**: Example:
```java
switch (choice) {
```
9. Loops:
- **For loop**:
```java
System.out.println(i);
```
- **While loop**:
```java
int i = 0;
while (i < 5) {
System.out.println(i);
i++;
```
10. Arrays:
```java
System.out.println(arr[i]);
```
- Common methods:
- Example:
```java
return a + b;
```
- Writing to a file:
```java
fw.write("Hello, world!");
fw.close();
```
- Example:
```java
try {
int result = 10 / 0;
} catch (ArithmeticException e) {
```
- Programs for patterns, number manipulations, sorting arrays, and string operations.