Ljava.lang.Object, What's wrong with @ba8a1dc?
Because you read the data from the database, when you deposit to the list collection, if you do not specify the type of data to be stored, the system will automatically assign you an object type, he is the originator of the class, You take the data out and transform it into the type of data you want to display. Its value is equal to getclass (). GetName () + '@' + integer.tohexstring (hashcode ())
The toString method of the object class returns a string that consists of the class name (the object is an instance of the class), the at marker "@ "and an unsigned hexadecimal representation of this object hash code.
Randomly generate A number of numbers, populate an array, and then display the array contents with a message box, then calculate the array elements and display the results in a message box.
Design ideas:
Use a for loop to control the number of random and cumulative occurrences, and output the result after jumping out of the loop.
Program Flowchart
SOURCE program code
Import Java.util.Random;
Import javax.swing.*;
public class Sjxj {
public static void Main (string[] args) {
TODO auto-generated method stubs
int add=0,i=0;
int a[];
a=new int [10];
Random rd=new random ();
for (i=0;i<10;i++)
{
A[i]=rd.nextint (100);
Add+=a[i];
}
String s=a[0]+ "" +a[1]+ "" +a[2]+ "" +
a[3]+ "+a[4]+" "+a[5]+" "+a[6]+" "+a[7]+" "+a[8]+" "+a[9";
Joptionpane.showconfirmdialog (null,s, " random number ", joptionpane.closed_option);
String p= " result ";
Joptionpane.showconfirmdialog
(NULL, "The result is:"+add,p,joptionpane.closed_option);
}
}
Results
Generate random numbers and Windows display their and