Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: Beginners Java Question
PostPosted: April 28th, 2011, 12:15 pm 
Bronze Member
Offline

Joined: February 27th, 2011, 5:23 pm
Posts: 6 us
RS Status: P2P
Hey, I just started learning Java. I know this may be a stupid question but I already know how to write simple codes but is there a special program to run them? I use the eclipse IDE for coding and it has a run feature built in, do you also write the client that displays the program you wrote in Java? Here is one of the things I've written so far:

import java.util.Scanner;

class Calculator{
public static void main(String args[]){
Scanner Tyler = new Scanner (System.in);
double fnum, snum, answer;
System.out.println("Enter first number please.");
fnum = Tyler.nextDouble();
System.out.println("Enter second number please.");
snum = Tyler.nextDouble();
answer = fnum + snum;
System.out.println(answer);
}
}

Any help is appreciated. Thanks in advance.


Top
 Profile  
 
 Post subject: Register and login to get these in-post ads to disappear
PostPosted: April 28th, 2011, 12:15 pm 
Bronze Member

Joined: September 9th, 2004, 1:47am
Posts: 9047
Location: In your web browserz


Top
  
 
 Post subject: Re: Beginners Java Question
PostPosted: April 28th, 2011, 2:36 pm 
Rsbandb Donor
Offline

Joined: October 16th, 2005, 3:14 pm
Posts: 4731
Location: Kasnas City us
RS Name: Azek
RS Status: P2P
I think this is what you mean? I program in c# so I use visual studio's but I dont think it supports Java programming.

http://www.oracle.com/technetwork/topic ... downloads/index.html

_________________
Image


Top
 Profile  
 
 Post subject: Re: Beginners Java Question
PostPosted: April 28th, 2011, 4:13 pm 
Site Owner
Offline

Joined: September 9th, 2004, 9:26 am
Posts: 6991
Location: Wild Rose Country ca
RS Name: shane12088
RS Status: P2P
Read my articles on learning how to program. They're based in Java. They got everything from what to use to some starting exercises.

http://informer.rsbandb.com/article/201 ... g-how-to-program.htm

http://informer.rsbandb.com/article/201 ... o-program-part-2.htm

Also, what do you mean by "write the client that displays the program you wrote in Java"?

_________________


Top
 Profile  
 
 Post subject: Re: Beginners Java Question
PostPosted: April 28th, 2011, 6:36 pm 
Rsbandb Donor
Offline

Joined: October 16th, 2005, 3:14 pm
Posts: 4731
Location: Kasnas City us
RS Name: Azek
RS Status: P2P
Shane wrote:
Read my articles on learning how to program. They're based in Java. They got everything from what to use to some starting exercises.

http://informer.rsbandb.com/article/201 ... g-how-to-program.htm

http://informer.rsbandb.com/article/201 ... o-program-part-2.htm

Also, what do you mean by "write the client that displays the program you wrote in Java"?



I think he means like coding the thing that runs it, like Visual Studio's, so no you wouldnt.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Beginners Java Question
PostPosted: April 29th, 2011, 2:27 am 
Runite Member
Offline

Joined: October 14th, 2006, 5:44 am
Posts: 538 au
RS Name: Saturnyne
RS Status: P2P
Clan Name: Solum
Notepad++ is good, here's the website: www.notepad-plus-plus.org

_________________


Top
 Profile  
 
 Post subject: Re: Beginners Java Question
PostPosted: April 29th, 2011, 8:30 am 
Rsbandb Donor
Offline

Joined: October 16th, 2005, 3:14 pm
Posts: 4731
Location: Kasnas City us
RS Name: Azek
RS Status: P2P
Burnt Joint wrote:
Notepad++ is good, here's the website: http://www.notepad-plus-plus.org



You can't compile with it though, which I think he was asking about.

_________________
Image


Top
 Profile  
 
 Post subject: Register and login to get these in-post ads to disappear
PostPosted: April 29th, 2011, 8:30 am 
Rsbandb Donor

Joined: September 9th, 2004, 1:47am
Posts: 9047
Location: In your web browserz


Top
  
 
 Post subject: Re: Beginners Java Question
PostPosted: April 29th, 2011, 12:41 pm 
Site Owner
Offline

Joined: September 9th, 2004, 9:26 am
Posts: 6991
Location: Wild Rose Country ca
RS Name: shane12088
RS Status: P2P
BlueJ. It's nice and simple, mentioned in the articles.

_________________


Top
 Profile  
 
 Post subject: Re: Beginners Java Question
PostPosted: May 3rd, 2011, 2:38 pm 
Dragon Member
Offline

Joined: March 25th, 2005, 2:58 pm
Posts: 1664
Location: Nebraska us
RS Name: Ryan V 09
RS Status: Classic
You can write what is called a driver program for other classes that you write, but it is not necessary unless you're doing a pretty big project. The driver program will create a new object of the class, and then use its methods to do things.

like:

public class driverClass
{
public static void main(String args[])
{
// Creating an object from the outside class file
otherClass foo = new otherClass(Parameters to constructor);

// Using one of the object's methods
foo.otherClassMethod();
}
}

Not sure if this is what you were looking for.

_________________
Image
Spoiler for Nietszche Quote:

But what did such a Teuton afterwards look like when he had been "improved" and led into a monastery? Like a caricature of a human being, like an abortion: he had become a "sinner," he was in a cage, one had imprisoned him behind nothing but sheer terrifying concepts... There he lay now, sick, miserable, filled with ill-will towards himself; full of hatred for the impulses toward life, full of suspicion of all that was still strong and happy. In short, a "Christian"... - Twighlight of the Idols
Image


Top
 Profile  
 
 Post subject: Re: Beginners Java Question
PostPosted: May 4th, 2011, 9:20 am 
Dragon Member
User avatar
Offline

Joined: November 25th, 2005, 6:49 pm
Posts: 1034
Location: California us
RS Name: Sky Jace
RS Status: P2P
I have used JCreator and Netbeans as Java IDEs (of which I would recommend Netbeans). Make sure you download JDK, set its path (if necessary) in the IDE, and then you can compile and run your program. The same should apply to Eclipse.

_________________
Image
Image
Dragon Member #90


Top
 Profile  
 
 Post subject: Re: Beginners Java Question
PostPosted: May 4th, 2011, 7:12 pm 
Mithril Member
Offline

Joined: September 7th, 2010, 7:48 am
Posts: 100 ca
RS Name: newhero
RS Status: P2P
camelCase would be also nice to learn ;) im sure your teacher would love it also even more is tabing your code "i know this is a forum"

_________________
Image


Top
 Profile  
 
 Post subject: Re: Beginners Java Question
PostPosted: May 4th, 2011, 7:25 pm 
Rsbandb Donor
Offline

Joined: October 16th, 2005, 3:14 pm
Posts: 4731
Location: Kasnas City us
RS Name: Azek
RS Status: P2P
newhero wrote:
camelCase would be also nice to learn ;) im sure your teacher would love it also even more is tabing your code "i know this is a forum"



Funny not. I'm so use to using camelCase that I use it not when saving files >.<

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  

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

Jump to: