|
yeah the code is not a problem but i m actually trying to input String of digits from user and the same String should be passed to the method in the above method we are passing array of integers... please help ....how do we get to change with that....
|
|
|
|
|
Just add the method StringToArray and change a bit main , for instance:
public static void StringToArray(String sKeys, int [] iKeys)
{
int i;
for (i=0; i<sKeys.length(); i++)
{
iKeys[i] = (int)(sKeys.charAt(i)-'0');
}
}
public static void main(String[] args) {
int [] iKeys;
String s = "123";
iKeys = new int[s.length()];
StringToArray(s, iKeys);
_out = new char[100];
comb(iKeys, 0);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thx for help but my problem isnt solved yet...
the method comb is required to have the parameter passed as a String not integer of arays
thx in advance....
|
|
|
|
|
harshad bhatia wrote: the method comb is required to have the parameter passed as a String not integer of arays
Why?
Is it an assignment (i.e. homework?)?
Anyway you can easily figure out the necesary modifications, I suppose
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
yeah it is part of assignment its is like where i m struck in makin the method plz if u can help me out....
|
|
|
|
|
i think i could do it now really thx for ur help......
|
|
|
|
|
Please can some send me the code of this program:
A Bus company charges $1 for distance upto 10km. For any additional Km, a passenger is charged $0.2. These are charges for adults during weekdays. Children and students are charged $0.5 and additional $0.1 for any additional Km. During weekends everyone is charged $0.7 irrespective of whether is adult,child or student. Write am object oriented program that allows you to print tickets for passengers with the fate on them.
Please help me. you can either give me the general idea of how to do it. Thank you very much.
|
|
|
|
|
This sounds like school work to me.
Read number 9.[^]
The idea is that your actually ment to learn how to do this, not pass other peoples work as your own.
IMO your a lazy cheat.
My failometer is detecting vast quantities of FAIL!
|
|
|
|
|
What have you done so far?
Have you troubles with the Java language or with program logic?
Please be specific.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
hi there
Trying too write a java program on towers of hanoi
It supposed to written in stack class.
There is a Peg class and Board class.
I have no where to begin with this
Please Help???
Thanks
|
|
|
|
|
Hohepa Hori wrote: Trying too write a java program on towers of hanoi
It supposed to written in stack class.
There is a Peg class and Board class.
I have no where to begin with this
Well, begin with Board class...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I have spent all day trying to figure out this junkstuff and seem to be getting nowhere.
I could have had this damn application done by now using ASP.Net or Silverlight but Nooooooooo.
Anyone have any words of wisdom on how to get simple navigation to work in JSPs?
I just want to be able to click on button on a templated page to move tot he next page and it doe snot seem to work. Of course I can just sett he navigation destination of the button.. Noooooooo I have to set this, then that, draw a link between pages in two areas, then blah blah blah blah blah blah..
ENOUGH!
|
|
|
|
|
what's wrong with Myeclipse7(all in one)???too slow,always stuck when I open a file
Undeniable:More information,more abilities,more energies,more time!
http://www.blogjava.net/tidelgl
|
|
|
|
|
I'm having troubles learning the concept of classes that extend Comparable. Any suggestions out there that could help my understanding? Same thing with abstract classes, I don't get the importance.
thanks in advance.
|
|
|
|
|
jonig19 wrote: I'm having troubles learning the concept of classes that extend Comparable
Which point don't you understand specifically ? If you want your objects to be comparable, you simply implement the Comparable interface and implement the CompareTo function. I really don't understand what you don't understand
jonig19 wrote: Same thing with abstract classes
Again, what is the point you don't understand ? Abstract classes are classes which should not be instanciated, they are only meant to be implemented by child classes. Thus, when you have abstract functions, it means that you have to implement those in your child classes.
|
|
|
|
|
Dear all,
i'm in a middle of a thesis.and i have some problem in getting the frame in video structure, so i can get it as an image.
can any body help me how to do it in java?
Thanx
|
|
|
|
|
any body here know to make Array of record in java script ..
can give me some example ...
thx b4 ..
regards
novhard
|
|
|
|
|
oredy have the answer ..
he he he ^.^
|
|
|
|
|
I've got an applet that needs to retrieve a "preview" of sorts of a file from within the applet. I think the best way to do this is to do what Windows Explorer does, and return an image of the file as a preview (or an icon if it can't preview, like returning the Microsoft Word icon for a .doc or .docx file). I have a feeling that this could be done through Shell32.dll. If so, how can I access that? And if not, is there another way to do this without having to save an image for every extension I might use beforehand?
Thanks.
|
|
|
|
|
hi i have written this code to execute a batch file in windows 2003 server R2
but it does not execute anything. it opens the cmd.exe window and does nothing also
the "Exit Value" and "Return Code" is 0.
can anyone help me about this?
is there any windows registry setting to restrict the execution of batch files programatically?
Thank you!!!!
try
{
Runtime runtime = Runtime.getRuntime();
Process process = null;
try
{
System.out.println( "Running: " + fName + ".bat " );
process = runtime.exec( "cmd /c start " + fName + ".bat" );
int returnCode = process.waitFor();
System.out.println("Exit value " + process.exitValue());
System.out.println("Return code value " + returnCode);
System.out.println("Finished running the SQL Loader script's process. " + " Exit Value = " + ( returnCode == 0? "Success" : "Failure" ) );
}
catch ( Exception e )
{
System.out.println(e.getMessage());
e.printStackTrace();
}
}
catch ( Exception e )
{
System.out.println( "Error running the sqlldr script: " + e );
e.printStackTrace();
}
|
|
|
|
|
if your bat script contains spaces or special characters you will need to enclose it in quotes... Dunno if that helps.
|
|
|
|
|
also ensure your path to the bat is readable by javaw -> try putting it in "C:\yourbatscript.bat"
|
|
|
|
|
i am getting the same results. the window title of cmd.exe is the exact path of the bat file but i didn't execute. maybe there is some kind of security setting for java not to invoke the batch files or a setting in windows server...
|
|
|
|
|
No i did this last week. Didn't set anything else.
webtools.java:
private void jButton13ActionActionPerformed(ActionEvent event) {
cmdExec cmd = new cmdExec();
String s = (cmd.run("ping www.google.co.uk"));
jTextPane0.setText(jTextPane0.getText() + s + "\n-----------------------------\n");
}
cmdExec.java:
package webtools;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class cmdExec {
public String run(String cmdLine) {
String line;
String output = "";
try {
Process p = Runtime.getRuntime().exec(cmdLine);
BufferedReader input = new BufferedReader
(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
output += (line + '\n');
}
input.close();
}
catch (Exception ex) {
ex.printStackTrace();
}
return output;
}
}
modified on Wednesday, April 22, 2009 10:13 AM
|
|
|
|