Jan 21

How to create and store elements in array in java

[pullquote]Arrays are datastructures used to store sequential collection of elements of same datatype.variables in java store single value at at time.To store multiple values at a time arrays are used in java.[/pullquote]

 

 

 

 

 

 

 

 

 

 

[code lang=”java”]public class ArraysCreationDemo {

public static void main(String[] args) {

// creating Integer array
Integer intArray[]=new Integer[5];

//storing elements in array

intArray[0]=1;
intArray[1]=2;
intArray[2]=3;
intArray[3]=4;
intArray[4]=5;

//Printing elements in array
for (Integer integer : intArray) {
System.out.println(integer);
}
}

}

[/code]

Output:

1
2
3
4
5

Jan 17

MySql Tutorial11:How to insert data in to table using mysql?

To insert the data in to table we use insert statement :
To insert a complete row we use the following statement:

INSERT INTO <table_name>

(column_name1, column__name2, column_name3)

VALUES(value1,values2,’value3′);

 

In the above statement we give table name and columnnames with values .

In the following screenshot records are inserted in to student table.

insertdata1