Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Need help with....JAVA

This is where you can discuss your homework, family, just about anything, make strange sounds and otherwise discuss things which are really not related to the Lancer-series. Yes that means you can discuss other games.

Post Thu Dec 25, 2003 4:58 pm

Need help with....JAVA

Yeh, I got a guide to learning Java for x-mas.

and as I am so hopeless, I got stuck in the first chapter, AND, I just need one command for now... If I need more help, I'll say it here

Anyway, this is the sitch:

public class App1_1
{
(tab) public static void main(String args[)
(tab) {
(tab)(tab) System.out,printIn("Hello, world!";
(tab) }
}

(tab) = that big space when you hit the tab button. I can't use it here...you all know why...

It all works, and a little box(command prompt style) comes up saying: Hello World

...and the box then just dissappears immediatly.

What I ask, is, how can I change it so that the box doesn't just close immediatly??


EDIT: No emoticons in the subject please.
Thats all I need at the moment...

Edited by - Stinger on 28-12-2003 07:30:25

Post Thu Dec 25, 2003 9:39 pm

e=mc2

Post Fri Dec 26, 2003 1:03 am

Arcon would be your best bet for JAVA questions around here. I did a beginners course on it about a year ago and I really sucked at it, so I can successfuly say I've forgotten most of what I learnt. But I would say your code wouldn't be the problem in this instance, I think there is a setting in the compiler from memory. What compiler are you using anyway?

Edited by - Mustang on 26-12-2003 01:05:03

Post Sat Dec 27, 2003 10:10 am

What type of output do u use? A console? how does the beginning of your program look? Which type of java do u use? Java or Ready to program?
If you still need help, mail me @ [email protected] then i'll try to help

The more I learn , the more I get to know, the more I get to know, the more I forget, so why should I learn?

Post Sat Dec 27, 2003 11:08 am

Uhm, well, my book is german, which will encounter problems. The book is called "Java Jetzt", and its sort of a beginners book to Java.

The program it uses is, I think, called Microsoft Visual J++.

The problem isn't that it doesn't work, but that the box comes up, and closes straight away. The program that runs the...program :p is called jview(.exe)

Thats about all I can say. I kinda just need a pause command, so that it won't close straight away.

P.S: Java Jetzt in english: Java now

Post Sat Dec 27, 2003 12:20 pm

Ahh, does it come up like an MSDOS prompt? If so right click on the .exe , go to properties and then click the program tab and uncheck the box that says "close on exit"

Edited by - Mustang on 27-12-2003 12:21:19

Post Sat Dec 27, 2003 12:47 pm

I didn't know that. I'm useless with Java and all that web stuff

Post Sat Dec 27, 2003 12:53 pm

Yeh, its in Command Prompt, but...what program tab?

Edit: Do you mean the jview.exe or what?

Edited by - Kendo THM on 27-12-2003 12:54:19

Post Sat Dec 27, 2003 4:24 pm

ok monkey, heres what you do:
(edit)
sod it:


^Thats the code really. but change "bleh" to whatever your file is called (i.e. if it was "bleh" it would be in the file "bleh.java"

secondly, i dont know if it was in your original code or whether it was in your conversion for the forum, but its "println" as in "PRINTLN" not "PRINTIN" the L can look like an I.

Thirdly, i use a program called JCreator, its really easy to use and is laid out like Visual C++ although the only bugger is it doesnt have the sysntax popups so you can quickly code it. Its worth a look though if your getting frustrated with VJ++. In JCreator, that above code of mine works perfectly.


"Something wicked this way comes"

Edited by - Arcon on 27-12-2003 16:30:53

Post Sat Dec 27, 2003 5:49 pm

Thanks

Ok, well, I'm just gonna ask a few questions where I'm not realy sure about..:

What do the following mean?:

bollean
byte
char
int
long
float
double

Well, not what they mean, but what they do...At the moment I'm abit confused, thats all...

thanks.

P.S: I'm no monkey

Post Sun Dec 28, 2003 12:05 am


Yeh, its in Command Prompt, but...what program tab?

Edit: Do you mean the jview.exe or what?




The program tab should be there if you are running XP. If not, look for an a check box that says "close on exit" and uncheck it. I am talking about the file you saved your java program as. If that doesn't have a .exe extention, then forget everything I said.

Post Sun Dec 28, 2003 12:58 am

kendo, u mean "boolean," do you not

are we still on Java then? 'cos half that stuff you listed is nowt to do with Java, it's o/s and hardware stuff. I'm really confused now!

Post Sun Dec 28, 2003 10:38 am

@ Mustang - the file extension is .java, so....

@ Tawa - yeh, sorry, slight misspelling

Post Sun Dec 28, 2003 5:49 pm

@Kendo: theses are all variable / data types:

boolean - these can be either 'true' or 'false'
byte - *shrug*
char - a single character (i.e. 'a' or '2')
int - an integer (whole number) (i.e. 43, 653)
long - a LONG integer (i.e. 5345265634)
float - a floating point number (i.e. 33.33333)
double - something like a float but i'm not sure TBH

Kendo, these should all be explained in your book. its essential information mate. I couldnt imagine a book telling you Java without explaining the basics of variables and datatypes.


"Something wicked this way comes"

Post Sat Jan 03, 2004 12:39 am

A byte is a short integer between -128 and 128 i think
double is with deciml places, its usually easier to use double than float

The more I learn , the more I get to know, the more I get to know, the more I forget, so why should I learn?

Return to Off Topic