Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Q 1,2
- public class MyClass {
- public static void main(String[] args) {
- System.out.println("Hello World");
- int a = 10, b = 5;
- // Using of +,-,*,/
- System.out.println("Sum = "+(a+b)+", Substraction = "+(a-b)+", Multiplication = "+(a*b)+", Division = "+(a/b));
- // + on strings
- String s1 = "Suresh" , s2 = " is a cool boy";
- System.out.println(s1+s2);
- }
- }
- /*
- Hello World
- Sum = 15, Substraction = 5, Multiplication = 50, Division = 2
- Suresh is a cool boy
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement