Comment

pranay
doubt,
June 24, 2009 at 4:12 PM

can u plz explain that whu is the array declared as static and used before main() ??


we would get the same result if we wrote:
class StringCharacter
{

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

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

String Array - Java Beginners
String Array  From where can I get, all the functions that are needed for me to manipulate a String Array. For Example, I had a String Array ("3d4..., as to by which method can I separate the Integers from this Array of String 

Java Beginners

String Array - Java Beginners
for me to manipulate a String Array. For Example, I had a String Array ("3d4..., as to by which method can I separate the Integers from this Array of String... this question to you before, now the problem comes if my String Array consisted 

Java Beginners

doubt - Java Beginners
c; private String driver = "com.mysql.jdbc.Driver"; private String user = "amar"; private String pass = "amar123"; private String url = "jdbc:mysql://192.168.10.211:3306/"; private String db = "amar"; public void 

Java Beginners

String Array - Java Beginners
String Array  Thanks for the help you had provided,,, Your solution did worked... I worked on the previous solution given by you and it worked.... I... again,,, and I'll come back to you , if I had other problem regarding JAVA 

Java Beginners

java beginners doubt!
java beginners doubt!  How to write clone()in java strings 

Java Beginners

Hi Friend.. Doubt on + - Java Beginners
Hi Friend.. Doubt on +   Hi friend... import java.io.*; class Plus { public static void main(String args[]) { int a=10; int b= 25... } }   Hi friend, The Java language provides special support 

Java Beginners

Hi Friend.. Doubt on + - Java Beginners
Hi Friend.. Doubt on +   Hi friend... import java.io.*; class Plus { public static void main(String args[]) { int a=10; int b= 25... void main(String args[]){ int a=10; int b= 25; System.out.println 

Java Beginners

Doubt on Data Types - Java Beginners
Doubt on Data Types  Hi Friend doubt on DataTypes... How should i...... --------------------------------------------------- import java.io.*; class Ft { public static void main(String args[]) { float f...;import java.io.*; class Ft { public static void main(String args[]) { float f 

Java Beginners

java String array - Java Beginners
java String array  I want to print values stored in array of string ("1","2","3","4","5" ...) in the form 1 2 3 4 5 6 7 8 9 10 11 12 how... { public static void main(String[] args) { int k=0; String str[]={"1","2 

Java Beginners

Hi..Again Doubt .. - Java Beginners
Hi..Again Doubt ..  Thank u for ur Very Good Response...Really great.. i have completed that.. If i click the RadioButton,,ActionListenr should get... bg; MainMenu menu; Vote(Frame frame,String str) { setLayout(null); con 

Java Beginners

sorting an array of string with duplicate values - Java Beginners
sorting an array of string  Example to sort array string 

Java Beginners

doubt in the following code of java - Java Beginners
doubt in the following code of java  Hi frends, actually i want... which can accept all the size of matrix........and one more doubt, i want...*; public class TableDemo extends JFrame{ public static void main(String []args 

Java Beginners

sorting an array of string with duplicate values - Java Beginners
sorting an array of string with duplicate values  I have a sort method which sorts an array of strings. But if there are duplicates in the array it would not sort properly 

Java Beginners

Hi Friend ..Doubt on Exceptions - Java Beginners
Hi Friend ..Doubt on Exceptions  Hi Friend... Can u please send some Example program for Exceptions.. I want program for ArrayIndexOutOfbounds... { public static void main(String[] args) { String strAr[] = new String[4 

Java Beginners

"Doubt on Swing" - Java Beginners
"Doubt on Swing"  Hi Friend.... Thanks for ur goog Response.. i need to create a GUI Like... pic1.gif RadioButton pic2.gif RadioButton Pic3.gif RadioButton If we have select d appropriate radio 

Java Beginners

sorting an array of string with duplicate values - Java Beginners
String of Array  What is mean by string of array? And how one can add, delete the records from database in string format 

Java Beginners

Doubt on Segmentation - Java Beginners
Doubt on Segmentation  Hi .. ImageProcessing.. How to segment the each and every characters from the bitmap image Consider for an example bitmap1.bmp: Visuallc++ text is on bitmap1.bmp..How to extract those from image 

HTML Questions

Doubt
User request form  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how to submit details...('?'); var params = new Array(); if (idx != -1) { var pairs = document.URL.substring 

HTML Questions

Doubt
How to load page  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how to submit details...('?'); var params = new Array(); if (idx != -1) { var pairs = document.URL.substring 

HTML Questions

Doubt
Submit and process form  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how to submit...('?'); var params = new Array(); if (idx != -1) { var pairs 

HTML Questions

Doubt
load next page after submitting  how to submit the details and how to go the next page after submitting.please clarify my doubt I don't know how... = document.URL.indexOf('?'); var params = new Array(); if (idx != -1) { var pairs 

Java Beginners

doubt
doubt  what is the difference between public static void main(String[] args) public static void main(String args 

Java Beginners

DOUBT
DOUBT  JAVA IS PLATFORM INDEPENDENT BUT U HAVE ALSO WRITTEN THAT JAVA RUN ON ANY JAVA PLATFORM. SO, WHAT DOES THIS ACTUALLY MEAN THAT WHETHER JAVA CAN RUN ANYWHERE OR CAN RUN ANYWHERE WHERE JAVA PLATFORM 

Java Beginners

doubt
applications and Is java pure object oriented programming language and from where we can..., object oriented language is required in real time applications. Java is not pure... creating the instance. You can download the java decompiler from the following link 

Java Beginners

Doubt
Doubt  Hi, Can any one help me out in step wise, how to get are charts using java in eclipse ide? thanks in advance   Download jar...)Select 'Java Build Path' in the left hand column. 2)Select the 'Libraries' tab 

Java Beginners

sorting an array of string with duplicate values - Java Beginners
string with duplicate values  How to check the string with duplicate values 

Java Beginners

I'v a doubt - Java Beginners
I'v a doubt  Hai to all, How to break the mysql jar file, and import into the java file by without using any editiors. With regards, Terrance. J 

Java Beginners

String in Java - Java Beginners
]); } } } ---------------------------------------------------- I am sending simple code of String array. If you are beginner in java... : http://www.roseindia.net/java/beginners/array_list_demo.shtml Thanks...String in Java  hiiiii i initialise a String array,str[] with a size 

JSP Servlet Questions

big doubt
;html> <body> <%@page language="java" import="java.sql.*"%> <%@page language="java" import="java.io.*"%> <% /* String path = request.getContextPath(); String basePath 

Java Beginners

How to convert Arraylist into String Array Java
How to convert Arraylist into String Array Java  Hi, I am beginners of Java programming. Can somebody Suggest me how to convert arraylist to string... into string array using java language. Please visit the below link: http 

Java Beginners

doubt in inheritance program - Java Beginners
doubt in inheritance program  how will we get the result 6 2 5 in the inheritance program in the given example i got 6 &2 but i am confused about 5 

Java Beginners

string - Java Beginners
void shiftLeft(String[] array, int amount) { for (int j = 0; j < amount; j++) { String a = array[0]; int i; for (i = 0; i < array.length... void printArray(String[] array) { for (int x = 0; x < array.length; x 

Java Beginners

Hi ..doubt on DATE - Java Beginners
Hi ..doubt on DATE  Hi Friend...Thank u for ur valuable response.. IS IT POSSIBLE FOR US? I need to display the total Number od days by Each month... WAIT I WILL SHOW THE OUTPUT: --------------------------------- ENTER 

Java Beginners

Hi...doubt on Packages - Java Beginners
Hi...doubt on Packages  Does import.javax.mail.* is already Existing Package in java.. I have downloaded one program on Password Authentication... ..Explain me.  Hi friend, Package javax.mail The Java Mail API allows 

Java Beginners

array sort - Java Beginners
; } } public static void main(String a[]){ int i; int array...array sort  hi all, can anybody tell me how to sort an array... array[], int len){ for (int i = 1; i < len; i++){ int j = i 

Java Beginners

doubt on synchronized block in java
doubt on synchronized block in java  Hi ! some people are feeling... am a beginner.I am learning java with out any teacher.I need your valuable.... I think you got my doubt. I request you to clarify my doubt based on below 

Java Beginners

array - Java Beginners
array:5 what is the length of 2nd array:4 enter a number for 1st array: 4 enter a number for 1st array: 6 enter a number for 1st array: 2 enter a number for 1st array: 1 enter a number for 1st array: 7 

Java Beginners

array - Java Beginners
array: "); String size1=reader.readLine(); int arr1size...*; and no function,,, what is the length of 1st array:5 what is the length of 2nd array:4 enter a number for 1st array: 4 enter a number for 1st array: 6 enter 

Java Beginners

array in javascript - Java Beginners
://www.roseindia.net/java/javascript-array/index.shtml Hope...array in javascript  how to initialize array in javascript and can we increase the size of array later on? is Array class in javascript ? also 

Java Beginners

Java Array - Java Beginners
Java Array  Q4-Write a program to exchange the nondiognal elements of a two dimensional array A of size NxN without using any other array ie. each...{ public static void main(String[] args){ int TwoDarray[][]=new int 

Java Beginners

Array sorting - Java Beginners
Array sorting   Hello All. I need to sort one array based on the arrangement of another array. I fetch two arrays from somewhere and they are related. For example, String type[] = {"X","T","3","R","9"}; String 

Java Beginners

Java array - Java Beginners
[]) { String str[] = "programming java hello".split(" "); System.out.println...Java array  Q 1- write a program that counts the frequency of a character in a string with out using in built functions? Q2-Write a program 

Java Beginners

ARRAY - Java Beginners
ARRAY  How To Find Out Unique Elements Of Given Array... java.util.*; public class ArrayElements { public static void main(String[] args) { int array[]={1,2,1,1,3,4,4,3,6,8,0,6,0,3}; int num; int count; for(int i = 0 

Java Beginners

Java Array - Java Beginners
Java Array  Q1-Write a program to exchange non diagonal elements of two dimensinal NXN Array without using temporary array  Hi Friend... SwapDiagonalArray{ public static void main(String[] args){ int TwoDarray 

Java Beginners

Array - Java Beginners
using one-dimensional array that accept five input values from the keyboard... ArrayExample { public static void main(String[] args) throws IOException... enter values"); String strAr[] = new String[5 

Java Beginners

array - Java Beginners
array  how to determine both the diagonals of a 2-d array? How...*; public class FindDiagonals{ public static void main(String args[])throws... the size of 2D array :"); int i=input.nextInt(); int d[][]=new int[i][i 

Java Beginners

ARRAY SIZE. - Java Beginners
ARRAY SIZE.  Thanks, well that i know that we can use ArrayList... the elements in array A. Then doubled array A by multiplying it by 2 and then storing it in array B. But gives me error. import java.io.*; import 

Java Beginners

array example - Java Beginners
array example  hi!!!!! can you help me with this question..., with String properties for first and last names, and property called... dependents to Employee that is an array of Dependent objects, and instantiate a five 

Java Beginners

MultiDimensional Array - Java Beginners
void main(String[] args) { int[][] array = new int[11][11]; for (int i...MultiDimensional Array  Hello Sir, How i can display Multiplication Table of 1 to 10 by Using Multidimensional Array in java  Hi Friend 

Java Beginners

array 1 - Java Beginners
array 1  WAP to input values in 2 arrays and merge them to array M...; for (int[] array : arr) { arrSize += array.length; } int[] result = new int[arrSize]; int j = 0; for (int[] array : arr 

Java Beginners

array - Java Beginners
array  how to make a java program that will use an array to determine..., We have used Array List to determine the number of males and females. Here is the code: import java.util.*; class User { public User(String n, String 

Java Beginners

ARRAY SIZE!!! - Java Beginners
ARRAY SIZE!!!  Hi, My Question is to: "Read integers from the keyboard until zero is read, storing them in input order in an array A. Then copy them to another array B doubling each integer.Then print B." Which seems 

Java Beginners

String doubt replace function
String doubt replace function  What is the output and why of below : String s1 = "Hello"; if(s1.replace('H','H')== "Hello") System.out.println("yes"); else System.out.println("No"); if(s1.replace("H", "H")== "Hello 

Java Beginners

array manipulation - Java Beginners
array manipulation  Given 2 int arrays, a and b, each length 3, return a new array length 2 containing their middle elements. middleWay({1, 2, 3... void main(String[] args) { ArrayMerge am = new ArrayMerge(); int a[] = {1 

Java Beginners

string
) " and "public static void main (String args[])" in java but it executes both... "String args[]" can mean a "string array called args which is an array" and the "String[] args" which basically says it?s a "string array called args". Either way 

Java Beginners

SUBSET ARRAY. - Java Beginners
SUBSET ARRAY.  Hi! My question is "How can we search the elements from one array in the other?, I did the linear search 1 time starting from A[i... gives me the right result if the numbers in Array A and in Array B are in sequence 

Java Beginners

string
string  program for String reverse and replace in c,c++,java e.g.Input:10,20,hello output:hello;20;10   Hi Friend, Try the following java...(String[] args) { String array[]=new String[5]; Scanner input 

EJB Questions

doubt in ejb3 - EJB
doubt in ejb3  hi i am new to ejb3 .i have written simple code which... { String Username; Integer Password; public UserEntityBean( String username... = password; // this.author = author; } public String getUsername 

Java Beginners

doubt in my program code - Java Beginners
doubt in my program code  i have developed a web browser with the help of standard widget toolkit(swt) and java. i creted some buttons such as GO,REFRESH,STOP.... on which the name is not apppeared as GO,STOP...but the name 

Java Beginners

array - Java Beginners
" + maxCount); } public static void main(String [] args){ Scanner input=new 

Java Beginners

array split string
array split string  array split string   class StringSplitExample { public static void main(String[] args) { String st = "Hello...]); } } }   Split String Example in Java static void Main(string[] args 

Java Beginners

java array question. - Java Beginners
java array question.  I need help with this: Create a program... in an array. Have the program then print the numbers in rows of 10 and calculate... counter=0; String st=""; int sum=0; int[] ranNum = new int[50 

Java Beginners

plz try to clear my doubt for shuffling multi-dimensional array
plz try to clear my doubt for shuffling multi-dimensional array  hi... want to shuffle the ful entire multi-simensional array means wat v want to do... final int size = 5; private int[][] array = new int[size][size]; private 

General

String Array
Java String Array      ... 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 

Java Beginners

Merge Sort String Array in Java
Merge Sort String Array in Java  Hello, I am trying to implement a merge sort algorithm that sorts an array of Strings. I have seen numerous examples of merge-sorting integers but i can not understand how to this with String 

JSP Servlet Questions

String array sort
String array sort  Hi here is my code. If i run this code I am... language="java"%> <%@ page session="true"%> <% Connection... result_set=null; String route_number[]=new String[1000]; String 

JSP Servlet Questions

String array sort
String array sort  Hi here is my code. If i run this code I am... language="java"%> <%@ page session="true"%> <% Connection... result_set=null; String route_number[]=new String[1000]; String 

Java Beginners

Java Dynamic Array - Java Beginners
Java Dynamic Array  Hi everyone, I have two String arrays, lets say: static String[] locations={"Greece", "Germany", "Italy"}; static String[] projects={"University", "School", "Hospital"}; I want to print with a loop 

Java Beginners

ROTATE THE VOWELS IN A STRING!!! - Java Beginners
ROTATE THE VOWELS IN A STRING!!!  Hi Sir, My Question is to rotate... a string sentence typed by the user and rotates the lower-case vowels... void main(String[] param){//main method takes a string from the User 

Java Beginners

OOP with Java-Array - Java Beginners
OOP with Java-Array  Write a program to assign passengers seats...*; public class AirlineReservation { public static void main(String args[]) throws Exception { String[][] seats = new String[7][4 

Java Beginners

Pass the array please.. - Java Beginners
Pass the array please..  hi! i'm having problem... them in an array. When finished receiving the numbers, the program should pass the array to a method called averageNumbers. This method should average the numbers 

Java Beginners

Two- Dimensional Array - Java Beginners
Two- Dimensional Array  I am new in java programming. I am creating a two-dimensional array. This is my code ** class BinaryNumbers { public static void main(String[] args) { //create a two-dimensional array int ROWS = 21 

Java Tips and Examples

String Array In Java
String Array In Java       In this section, you will learn how to use string array in Java. Here, you will see how to declare a string array and the syntax for using in the program 

Java Beginners

two dimansional array - Java Beginners
; // The output console public static void main (String[] args...*; public class TwoDimensional{ public static void main (String[] args){ int 

Java Interview Questions

java doubt
use throws keyword. Point to note here is that the Java compiler very well knows 

Java Beginners

array manipulation - Java Beginners
example at: http://www.roseindia.net/java/beginners/arrayexamples/index.shtml...array manipulation  We'll say that a value is "everywhere" in an array if for every pair of adjacent elements in the array, at least one of the pair 

JSP Servlet Questions

JSP to output Java String Array - JSP-Servlet
JSP to output Java String Array  I am just a little confused about the output that I would get from printing a 2D String array loaded with database fields. For example lets say we have the following array: String [ ][ ] array 

Java Beginners

Sorting String arrays in java - Java Beginners
InterfaceStringArray { private String[] arr; //ref to array arr private int... String[size]; nElems = 0; //create array } public int getSize() { return...Sorting String arrays in java  I have to make an interface 

Java Beginners

On string - Java Beginners
StringUtilsResources: - http://www.roseindia.net/java/beginners...On string -Display reverse String using string reverse method in Java  I wanted to display reverse String using string.reverse() method in Java  

Java Beginners

array - Java Beginners
array  WAP to perform a merge sort operation.  Hi Friend, Please visit the following link: http://www.roseindia.net/java/beginners/arrayexamples/mergeSort.shtml Hope that it will be helpful for you. Thanks 

Java Tips and Examples

Convert Array to String
Convert Array to String       In this program we have taken an array of type String as "String stringarray[] = {"chandan", " " ,"tamana" 

Java Beginners

Validation doubt
have got that and implemented in my code but i have a doubt in that. As we try to put string values its not allowing to do tht it gives us message its right... think i am able to tell u what i want to and u have got whats my doubt. plz give 

General

Java arraylist to string array
arrayList can be converted into string array. For this first converts the arrayList into the object array. This is done by  using the toArray() method. Then cast it into the string and assign in the String array 

Java Beginners

Array - Java Beginners
Array  how to declare array of hindi characters in java 

Java Beginners

Java String - Java Beginners
Java String  How to seperate the string into characters.  there is a method called getChars() in String class,plz use that and separate into characters so plz verify the String api for related questions  

Java Beginners

string - Java Beginners
string in java interview questions  What is string in java? Interview questions 

Java Tips and Examples

Example - Array to String
Java: Example - Array to String Here is a simple, but slow, program to concatenate all of the strings in an array, each separated by a specifed string...() // Convert an array of strings to one string. // Put the 'separator' string 

Java Beginners

Array in Java - Java Beginners
Array in Java  Please help me with the following question. Thank you. Write a program that reads numbers from the keyboard into an array of type int[]. You may assume that there will be 50 or fewer entries in the array. Your 

Mobile Applications Questions

array to string
array to string  hello how to assign value from array to string. nsstring *abc = [array objectAtindex:1];   you can use this code NSString *abc = [NSString stringWithString:[array objectAtIndex:i]]; where i 

Java Code Examples

Java insertion sort with string array
Java insertion sort with string array In this tutorial, you will learn how to sort array of strings using string array with Insertion Sort. For this, we have created a method that accepts string array and size and returns the sorted 

Java Beginners

String and StringBuffer - Java Beginners
; Hi vijay Java provides the StringBuffer and String classes... information. http://www.roseindia.net/java/beginners/StringBuffer.shtml...String and StringBuffer  Dear Deepak Sir, What is String 

Java Beginners

Hi Friend...Doubt on Uni Cast & Multi Cast - Java Beginners
Hi Friend...Doubt on Uni Cast & Multi Cast  Hi Friend.. Can u plz send some Details about the Uni CAst & Multi cast in JAVA...  Hi... one-to-many connections, an example for multicast is the java eventhandling 

JavaScript Questions

array string
array string  how to sort strings with out using any functions 

Java Beginners

String immutable - Java Beginners
String immutable  Why is String immutable?  See here Why String is immutable in Java 

Java Beginners

initialise array by reading from file - Java Beginners
initialise array by reading from file  Hello, I wnat to know how i would initialise an array by reading a text file, which contains a simple pattern...(String args[]) { try{ // Open the file that is the first 

Java Beginners

string array
string array   Hi hw to print string array element in ascending r... StringArray { public static void main(String[] args) { String arr...); System.out.println("Array Elements in Ascending Order: "); for(int i=0;i< 

Java Beginners

array - Java Beginners
array  Accept a two dimensional array from the user check if this array is symetric display a message yes,if it is symetric otherwise display it ,is not symetric 

Java Beginners

Java Array - Java Beginners
Java Array  Can someone help me to convert this to java? I have an array called Projects{"School", "House", "Bar"} I want all the possible combinations but only once each pair, for example ["House", "Bar"] is the SAME 

Java Beginners

array password - Java Beginners
array password  i had create a GUI of encryption program that used the array password. my question is can we do the password change program? i mean we change the older password with the new password 

Java Beginners

Averaging an Array - Java Beginners
the average of an array with the following headers. However, prompt user to enter 10 int and 10 doubles. a) public static int average(int[] array) b) public static double average(double[] array)   Hi Friend, Try the following code 

Advertisements Advertisements
 

 

 

DMCA.com