Skip to main content

Basic Program: WAP to print difference of 20 &60

Print Difference of 20&60

import java.util.*;
class java
{
public static void main()
{
int a,b,c;
a=20;
b=60;
c=a-b;
System.out.println(c);
}
}

Explanation:-

Packages:-
1. import java.util
2. public static void main()

Defining Class
1. class java:- it is used to define class in JAVA
2. (;) to end the specific line
3. System.out.println(c): to give the output of the program
4. "{" it is for opening the program
5. "}" used to close the program

Comments

Popular posts from this blog

Phase 1:- Practical And Therory

1. Theory a. Object Oriented Programming b. Introduction To Java And BlueJ 2. Practical 1. Basic Program 2. Input Programs using Scanner 3. For Loop 4. While Loop 5. Do-While Loop 6. Nested Loop(Pattern Programming) 7. Input Inside Loop 8. Input Outside Loop 9. Input through parameter 10. Switch-Case Programming Important:- We will be completing our phase 1 by use import java.util.*; library. Use BlueJ and jdk 7.1 for programming