Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • 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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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