Praveen Jadhav

Greenhorn
+ Follow
since Nov 28, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Praveen Jadhav

hi rohan,
when u give join statment parent thread wait till child thread is completed.
Go thru following code and observe the output and then observe the output by comment the join
class Threadtest extends Thread
{
Thread t;
public static void main(String[] args)
{
System.out.println("main thread started");
Threadtest tt = new Threadtest();
tt.start();
System.out.println("Reach before joined");
try
{
tt.join();
}
catch (Exception e)
{
System.out.println("error in join");
}
System.out.println("Reach after joined");
}
public void run()
{
System.out.println("Started new Thread ");
for(int i = 1 ; i<5 ; i++)
{
try
{
sleep(100);
System.out.println("I increamented to "+ i);
}
catch(Exception e)
{
System.out.println("error in sleep");
}
}
}
}

[This message has been edited by Praveen Jadhav (edited January 03, 2001).]
19 years ago
hi everybody
I want to know whether we can use any dll in java??
if yes then how we can use it??
The problem is that i want use Microsoft.xmlhttp like component in java.
if we can't use dll in java then can anybody tell me whether there is any class or component available in java which is similar to Microsoft.xmlhttp??
19 years ago
hi asheesh
here it the best possible code according to me for the query u have told

import java.text.*;
class Sreplace
{
public static void main(String[] args)
{
String s,s1;
s=args[0];
s1="";
System.out.println(s);
for (int i = 0;i < s.length() ; i++)
{
if (s.charAt(i)!=',')
{
s1 = s1 + s.charAt(i);
}
}
double lvar;
lvar = Double.parseDouble(s1);
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumFractionDigits(2);
nf.setMaximumFractionDigits(2);
s1 = nf.format(lvar);
System.out.println(s1);
}
}

convert the above code in proper function and u can use it
presently , u have pass command line argument to get ur output
19 years ago
hi preety,
what u have to do is set classpath till the parent directory of ur package(in the way u want to import)
case 1)
suppose in ur program , if ur writing
import Suncertify.db;
then class path has to set to (in command line syntex)
>set Classpath = %Classpath%;c:\;
case 2)
suppose in ur program, if u r writing
import db;
then class path has to set to (command line syntex)
>set classpath = %classpath%;c:\suncertify\;

Similary u can edit ur autoexec.bat and make the nesscessary changes in
CLASSPATH= ...
regards
praveen
19 years ago
Thanks Bodie,
I have modified by code to
import java.lang.*;
import java.io.*;
class Trial{
public static void main(String args[]){
try{
int a=0;
Runtime r;
Process p;
r = Runtime.getRuntime();
p = r.exec("cmd.exe");
DataOutputStream dos = new DataOutputStream(p.getOutputStream());
dos.writeBytes("dir\n");
dos.flush();
DataInputStream dis = new DataInputStream(p.getInputStream());
String s = null;
while( (s=dis.readLine()) != null)
{
System.out.println(s);
}
p.destroy();
System.out.println("after destroy");
} catch (Exception e){
e.printStackTrace();
}
}
}
and it is working fine.
thanks a lot.
19 years ago

The \" is used to print " in your output.
19 years ago
Hello javaranch,
I am exploring Runtime Class
The following code works fine
Runtime.getRuntime().exec("notepad.exe");
but when i try to run dos command using Runtime class like
Runtime.getRuntime().exec("Dir");
It is throwing IOException
Plese guide me what is problem?
19 years ago