Solved

passing data

Posted on 1998-08-28
4
189 Views
Last Modified: 2012-05-04
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
Comment
Question by:afsac
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
msmolyak earned 100 total points
ID: 1222862
Look like the class Create_Html has a constructor which expects a String, not an array. Why are you passing an array?
0
 
LVL 5

Expert Comment

by:msmolyak
ID: 1222863
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
 
LVL 3

Expert Comment

by:sailwind
ID: 1222864
Uhmm.. no msmolyak. The constructor is expecting an array, not a string.
try doing  new Create_Html(buf1);  instead.
0
 

Author Comment

by:afsac
ID: 1222865
THANX!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question