Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kevinlyman7

macrumors newbie
Original poster
Jul 26, 2010
1
0
I just started my first programming class and we use jgrasp in class so i'm used to the very basics. here is my code, it's in java, please spare me any opinions about c++ or anything. We are starting our class with java, and i need to practice but i'm not sure how to work xcode.

//
// pleasework.java
// Tryagain
//
// Created by Kevin Lyman on 7/27/10.
// Copyright 2010 fatkids_inc. All rights reserved.
//

public class pleasework {
public static void main(String args[]) {

System.out.println ("Hello Kevin.");

}

}

when i run the program it asks me if i'd like to stop the executable "tryagain" i click ok and then i get a text box that pops up that says "java application" in it where i presume the words "hello Kevin" should be. What am i doing wrong, i just want to compile and run code to practice for class and do home work.
 
I'd stick to something like Netbeans or Eclipse really for Java. You can use Xcode for it but the later versions have made it quite tough (you need to create your projects through the Xcode Organiser).
 
Do you have the console open when you run the application?

You should see your text in the console rather than in a pop-up window.
 
Not sure, but will it even compile with the class name all lowercase? Use "public class Pleasework" and not "public class pleasework".
 
Not sure, but will it even compile with the class name all lowercase? Use "public class Pleasework" and not "public class pleasework".

Yes it will, although it is bad form. Java is case sensitive but attaches no special meaning to camel case. It's convention (and should be followed, unless you have a good reason not to (you don't)).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.