Solved

passing data

Posted on 1998-08-28
4
181 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
solarwind tftp server 2 45
Java Filesystem manipulation of Word Docx file (find replace text) 3 67
servlet filter example 37 46
hibernate jars 4 9
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

864 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now