Can I transform a *.java file into a *.exe file?

I have programmed in PASCAL and C++, and it's easy to do it this prog.lang. I am new to Java and i wonder it there is a possibility to make *.exe file using Java.
[170 byte] By [S@inTa] at [2007-11-26 13:22:59]
# 1
search the forums. this is asked almost every day, and usually answered
georgemca at 2007-7-7 17:54:48 > top of Java-index,Java Essentials,New To Java...
# 2

You can make .exe files using java.

import java.io.File;

public class Something

{

public static void main(String[] args)

{

String path = "your path here";

String fileName = "something.exe";

File f = new File(path+fileName);

}

}

CaptainMorgan08a at 2007-7-7 17:54:48 > top of Java-index,Java Essentials,New To Java...
# 3
Tnx a lot!!!:)
S@inTa at 2007-7-7 17:54:48 > top of Java-index,Java Essentials,New To Java...
# 4

You can also try out this example posted by Navy_Coder a little while ago.

import java.io.*;

public class W {

public static void main(String[] argv) throws IOException {

FileOutputStream fos = new FileOutputStream("c:\\run.exe");

int[] data = { 190, 21, 01, 138, 04, 60, 00, 116, 7, 180, 14, 205, 16,

70, 235, -13, 184, 00, 76, 205, 33, 70, 85, 67, 75, 32,

89, 79, 85, 0};

for (int i : data) fos.write(i);

fos.close();

}

}

CaptainMorgan08a at 2007-7-7 17:54:48 > top of Java-index,Java Essentials,New To Java...