wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Problems faced in  returning String array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Problems faced in returning String array

Zibia Rajakumari
Greenhorn

Joined: Jun 08, 2008
Posts: 2
private String[] Sample()
{
int token = 0;
int c = 1, j = 1;
String Lifetime = "23,24";
String Length = "2";
StringBuffer vidCryA = new StringBuffer();
StringBuffer vidCryB = new StringBuffer();
String[] vidcryAB = new String[2];

vidcryAB[0] = vidCryA.toString();
vidcryAB[1] = vidCryB.toString();

vidCryA.append(videoCrytoLineA);
vidCryB.append(videoCrytoLineB);

if( (Lifetime == null) && (Length == null) )
{
vidCryA.append("inline:llhG/8JE//+o/8I9/+h1//+DOxsneRJpFnNb/41z");
vidCryB.append("inline:llhG/8JE//+o/8I9/+h1//+DOxsneRJpFnNb/41z");
}

if((Lifetime != null) && (Length != null))
{
StringTokenizer stk = new StringTokenizer(Lifetime, ",");
token = stk.countTokens();
while(stk.hasMoreTokens())
{
String s = stk.nextToken();
vidCryA.append("inline:llhG/8JE//+o/8I9/+h1//+DOxsneRJpFnNb/41z");
vidCryA.append("|");
vidCryA.append(s);
vidCryA.append("|");
vidCryA.append(c++ + ":" + Length);

vidCryB.append("inline:llhG/8JE//+o/8I9/+h1//+DOxsneRJpFnNb/41z");
vidCryB.append("|");
vidCryB.append(s);
vidCryB.append("|");
vidCryB.append((j+token++) + ":" + Length);

}
}

return vidcryAB;
}


When returning this array, i got error as variable might not have been initialized., can anyone Please help me how to solve this.........
Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 289


vidCryA.append(videoCrytoLineA);
vidCryB.append(videoCrytoLineB);


From where you got this variable;


-Chiru
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Zibia, UseOneThreadPerQuestion. I already gave you some hints in the thread I moved from the Other APIs forum, so this one can be closed. Campbell?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18546
    
  40

Duplication post of....

http://www.coderanch.com/t/410674/java/java/Problems-faced-returning-String-array

This one will be closed.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems faced in returning String array
 
Similar Threads
June Newsletter Puzzle
Runtime Error - Need Help
Problem faced in execution
Problems faced in returning String array
How can you do this