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

Java Program Example in Eclipse

This Java program defines a class called MFRP with static integer variables a and b initialized to 20 and 30. It contains a static add() method that prints the values of a and b, calculates c as the sum of a and b, and prints c. The main() method calls the add() method and also prints a welcome message.

Uploaded by

rsingh2310
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java Program Example in Eclipse

This Java program defines a class called MFRP with static integer variables a and b initialized to 20 and 30. It contains a static add() method that prints the values of a and b, calculates c as the sum of a and b, and prints c. The main() method calls the add() method and also prints a welcome message.

Uploaded by

rsingh2310
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Java Simple Program In Eclipse: Program1: package javapackage;#create java package public class MFRP { #create class name

public static int a=20; public static int b =30; public static int c; public static void add() #creating functions { [Link] (a); [Link] (b); c=a+b; [Link](c); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Add (); #calling the function in the main() [Link] ("Hai welcome"); } }

You might also like