Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

Problems faced in returning String array

 
Zibia Rajakumari
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 290
Hibernate Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator

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


From where you got this variable;
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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?
 
Henry Wong
author
Marshal
Pie
Posts: 20836
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic