Java Tutorial

 
 
 
 
import java.awt.*;
import java.applet.*;

public class passingPara extends Applet
{
       String str;
       int a,b,result;

      public void init(){
             str=getParameter(\"a\");
            a=Integer.parseInt(str);
            str=getParameter(\"b\");
            b=Integer.parseInt(str);
            result=a+b;
            str=String.valueOf(result);
        }

    public void paint(Graphics g){
          g.drawString(\" Result of Addition is : \"+str,0,15);
    }
}

    Related Post:
  1. Define an array of ten String elements each containing an arbitrary string of the form “month/day/year”

  2. Program which calls the method sort(int []a) which throws the Exception ArithmeticException, NullPointerException, ArrayIndexOutOfBoundsException

  3. Program to determine the sum of the following harmonic series for a given value of n

  4. Program to show an example of using Abstract Class and Abstract Method

  5. Program that will count the number of lines in each file that is specified on the command line

  6. Program to show the use of Labeled Continue Statement

  7. Program to append a StringBuffer by StringBuffer, String objects and other Basic Data Types

  8. corba program of client and a DNS server where given a URL the server sends back an IP address

  9. Program to show insertion of StringBuffer, String objects and other Basic Data Types into a StringBuffer object

  10. Program to show the use of Bitwise Operator (^) XOR (Exclusive OR)

  11. Program to show the use of Logical or Boolean Negation i.e. NOT (!)

  12. Program to show an example of using a Non-Static Nested Class

  13. Program to show the use of operator (<<) Shift Left filling with zero from the right

  14. An applet program of linear sort

  15. Program to show the comparing of Strings for equality

  16. Program to show an example of Polymorphism

  17. Program of Floyds Triangle

  18. Corba program to encrypt the text that you want to send on the client side. The server side decrypts it after receiving. Append server time.

  19. An applet program to draw different shapes

  20. Program to show an example of overloading constructors in a class to initialize its data members

 
 
Didn't find what you were looking for? Find more on An applet program of passing parameters