0% found this document useful (0 votes)
4 views1 page

Handwritten Java Programs

The document provides Java programming examples for basic tasks: printing 'Hello World', adding two numbers, and checking if a number is even or odd. Each example includes the corresponding code snippet. The content is concise and focused on fundamental programming concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Handwritten Java Programs

The document provides Java programming examples for basic tasks: printing 'Hello World', adding two numbers, and checking if a number is even or odd. Each example includes the corresponding code snippet. The content is concise and focused on fundamental programming concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Write a Java program to print 'Hello World'


Ans: public class HelloWorld {
public static void main(String[] args) {
[Link]("Hello World");
}
}

2. Write a program to add two numbers.


Ans: public class AddNumbers {
public static void main(String[] args) {
int num1 = 10;
int num2 = 20;
int sum = num1 + num2;
[Link]("Sum: " + sum);
}
}

3. Write a program to check even or odd.


Ans: if (number % 2 == 0) → Even else Odd

... (Content shortened for handwritten format)

You might also like