Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Java-conversion String Array

Related Tutorials


 
 

Share on Google+Share on Google+

String Array

Advertisement
This is simple java string program. In this section we will learn how to make use of string array.

Java String Array

     

This is simple java string  program. In this section we will learn how to make use of string array. In the java programming tutorial string, which are widly used in java program for a sequence of character. String are represents character string. This program are implemented such as "rose!" as instance of class.  If string are constant, their values cannot be changed after they are created. A string buffers support multiple strings. Here in this program we are going to use string type array. We have to used array as data structure to hold values that are same type. The array are an alternative to java collection classes such as Arraylist and LinkList. This program have to going to provide for complete illustration with java source source below:

Description of program:

In this program you will be read how to use string of array. First of all, we have to define class named "StringCharacter". Inside of class we have to define a string of array values. After that we are going to applying for loop condition as with int "i", i < 5 and i++ as for increment. So output will display on the screen by using println() system class.

Here is the code of this program:

class StringCharacter 
{
  static String[] roseindia={"chanan","tapan","Amar","santosh","deepak"};
  public static void main(String args[]){
  for(int i=0;i<5;i++){
  System.out.println(roseindia[i]);
  }
  }
}

Output of program:

C:\amar work>javac StringCharacter.java

C:\amar work>java StringCharacter
chandan
Amar
tapan
santosh
deepak

C:\amar work>

Download this Example.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 25, 2008

Related Tutorials

Discuss: String Array   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
pope
September 22, 2012
IT-101/102

How to create a program that ask for a string, if the input string is contain a number it display "invalid input" otherwise display the reverse of the input string. Ex. input string: ABCDE output:EDCBA... pls help me.. i need. i will submit this problem on monday.. plsssss...
DMCA.com