Java Blog

 
 
 
 public class JAVA_065
 {

    static int[] values=new int[10];

    int count;

    static
    {
       System.out.println(\"Running static initialization block.\");

       for(int i=0;i<values.length;i++)
          values[i]=(int)(100*Math.random( ));
    }

    {
       System.out.println(\"Running initialization block.\");

       count=10;
    }

    void list_values( )
    {
       for(int i=0;i<values.length;i++)
          System.out.print(values[i]+\" \");

       System.out.println(\"\\nCount = \" + count);

       System.out.println( );
    }


    public static void main(String[] args)
    {
       JAVA_065 obj=new JAVA_065( );

       System.out.println(\"\\nFirst Object : \");

       obj.list_values( );


       obj=new JAVA_065( );

       System.out.println(\"\\nSecond Object : \");

       obj.list_values( );
    }
 }

    Related Post:
  1. Program that takes a long sentence and a character from the client and count the occurrence of the character in the sentence at the server side

  2. An applet program to display Horizontal Color Bar

  3. Program of linear search

  4. Program to compare Strings by compring successive corresponding characters, starting with the first character in each String

  5. Biological Sequence Allignment Using Dynamic Programing

  6. Program to declare, initialize and print a StringBuffer object

  7. Program to show the use of Nested If-Else Statements

  8. An applet program to display moving banner

  9. Program to print some text on the same line using multiple print statements

  10. Corba program to develop a simple calculator with addition, subtraction, multiplication and division capabilities, data collection from client side

  11. Program to show an example of extracting subStrings from a String

  12. An applet program to draw concentric circle in center of the canvas

  13. Program of inventory management and demonstrating interactive input and output

  14. Program of an applet to display alternate filled and empty circle

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

  16. Program in CORBA which takes a long sentence from the client (at least 7 words), passes to the server, server separates out each word

  17. Program to show the use of Conditional AND Operator (&&) in If Statements

  18. Program for calculating area of a circle on server side,when a client sends request along with given radius and then displaying result on client side

  19. An applet program to display Vertical Color Bar

  20. Corba program of date operations