Joined: Tue 09-11-2001 2:34PM Posts: 1084 Location: Off Campus (i.e. not hell)
Source: VPN
Hey all you 1337zors
I have some pretty easy Java questions that I would like answered. I've never programmed in Java, and now I ahve a program due in it...in a 300 level course. Good times.
Basically, to get me started, I need to know how to write/run a Java program. I'm sure I can probably use notebook or something to write it but I don't have any software like VC++ for Java on my computer to run it, so what do I do to go about getting started?
Secondly, I have to use this Java to write an XML file. Which is just outputing a bunch of strings to either the command prompt, or in my case, a file stream. How do I open up a file stream in Java and output text to it? A sample of code that I could use the answers to the first question on would be great.
I think this should get me started, I might write back later with more questions if I choose to make the program more than barebones. I have a decent amount of experience with C and C++ so the concepts of programming are no problem, just syntax. I know I could use Google, but I've been up all night already on another assignment and am crashing for a bit. Having an answer when I wake up to work on would be great.
Thanks for the help in advance.
_________________ People with doctorate degrees get to be called Doctor. So yes, I guess I am your Master... bitch
Joined: Mon 04-15-2002 4:23PM Posts: 516 Location: Far, far away from Rolla (Colorado to be exact)
Source: Off Campus
Paradigm wrote:
Hey all you 1337zors
I have some pretty easy Java questions that I would like answered. I've never programmed in Java, and now I ahve a program due in it...in a 300 level course. Good times.
Basically, to get me started, I need to know how to write/run a Java program. I'm sure I can probably use notebook or something to write it but I don't have any software like VC++ for Java on my computer to run it, so what do I do to go about getting started?
Secondly, I have to use this Java to write an XML file. Which is just outputing a bunch of strings to either the command prompt, or in my case, a file stream. How do I open up a file stream in Java and output text to it? A sample of code that I could use the answers to the first question on would be great.
I think this should get me started, I might write back later with more questions if I choose to make the program more than barebones. I have a decent amount of experience with C and C++ so the concepts of programming are no problem, just syntax. I know I could use Google, but I've been up all night already on another assignment and am crashing for a bit. Having an answer when I wake up to work on would be great.
Thanks for the help in advance.
To get started go to http://www.javasoft.com and get the Java Development Kit (JDK) 1.5 (or another version if you need that...I think 1.5 has a lot of really cool new features to it). If you want a good IDE NetBeans is free and does a good job. Don't get the version where they bundle the JDK with it though. For XML stuff get JDOM (3rd party library, http://www.jdom.org)...it makes dealing with XML stuff very, very easy.
_________________ That's right. I'm gone. Rolla couldn't hold me. If you are still there, I know your pain. But I'm still going to laugh at you from far, far away.
Joined: Tue 09-11-2001 2:34PM Posts: 1084 Location: Off Campus (i.e. not hell)
Source: VPN
Well, I got JDK 1.5, looks alright, kinda figured some stuff out. But if I wanted to use the java executable to run a java class (lets call it Simple, and it has the public static void main(String args[]) statement inside of it, where do I put the file so that I can run
java Simple
and have it recognize the class??
_________________ People with doctorate degrees get to be called Doctor. So yes, I guess I am your Master... bitch
Joined: Mon 04-15-2002 4:23PM Posts: 516 Location: Far, far away from Rolla (Colorado to be exact)
Source: Off Campus
Paradigm wrote:
Well, I got JDK 1.5, looks alright, kinda figured some stuff out. But if I wanted to use the java executable to run a java class (lets call it Simple, and it has the public static void main(String args[]) statement inside of it, where do I put the file so that I can run
_________________ That's right. I'm gone. Rolla couldn't hold me. If you are still there, I know your pain. But I'm still going to laugh at you from far, far away.
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum