Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

passing data

I have code that looks like this:
String xxx="";
new Create_Html(buf1[j]);
//xxx = new Create_Html.Create_Html(buf1[j]);

I have tried both of the above neither works, i'm just
tring to pass data to code called Create_Html.
I get the following error message:

javac Create_List.java
Create_List.java:94: Incompatible type for constructor. Can't convert java.lang.String to java.lang.String[].
new Create_Html(buf1[j]);
                    ^
1 error

What am I doing wrong? I've done this with other code
with no problems. Can any one show me the way?

Thanx!
0
afsac
Asked:
afsac
  • 2
1 Solution
 
msmolyakCommented:
Look like the class Create_Html has a constructor which expects a String, not an array. Why are you passing an array?
0
 
msmolyakCommented:
Sorry, it's the other way around. The constructor expects an array of strings, but you are passing an element of that array. Change it to
  new Create_Html(buf1);
0
 
sailwindCommented:
Uhmm.. no msmolyak. The constructor is expecting an array, not a string.
try doing  new Create_Html(buf1);  instead.
0
 
afsacAuthor Commented:
THANX!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now