JAVA- Vectors
Vectors are created like the arrays but vector can hold the objects. And these objects can be of any type and size. In array the elements are must be homogeneous, …
Vectors are created like the arrays but vector can hold the objects. And these objects can be of any type and size. In array the elements are must be homogeneous, …
In StringBuffer class we can create the flexible strings. Means we can easily increase the length of a string if we required, which we cannot do in the String class. …
To declare a string the syntax is as follows: Syntax: String string-name; String-name = new String(“string-line”); This can be written in one line as: String string-name = new String(“string-line”); Methods: …
A string is a collection of characters and consider as a single data item. We can represent the string by following character array: char name[ ] = new char[9]; name[0]=’J’; …
In the single dimensional array we can store only values in the form of list, but sometimes we needs to process the data in the form of rows and columns …
The one dimensional array is the simplest form of the array. And is used for the multiple values in a single variable. Declaration syntax: data-type array-name[ ]; e.g: int student[ …
The problem with the simple data type is it can only save one value at a time, suppose we want to save the roll number of the all students of …
The for loop is also entry-controlled loop. Syntax: for(initialization; condition; increment/decrement) { Body of loop } Initialization: in this part of the loop the variable is initialized such as i=0; …
In while loop the condition is evaluated first and then executes the body of loop and if the condition is not satisfied even at the very first attempt the body …
while loop is the simplest form of loop, and it is entry controlled loop statement. Syntax: while(test condition) { Body of loop } At the first, condition is evaluated and …