Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 26th, 2005, 3:04 PM   #1
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
Different IDE's Different code

I've tried Eclipse and after creating a new project I've typed this in the code window:

public class Welcome{
public static void main(String args[])
{
System.out.println("Welcome to Java!");
}
}

When I run the program it outputs "Welcome to Java!".

Now when I try a different IDE like NetBeans that IDE adds a little more code to the code window so now it looks like this:

public class Welcome {

/** Creates a new instance of Welcome */
public Welcome() {
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Welcome to Java!");
}
}

So it appears that NetBeans has added public Welcome() to the code. I'm not sure but I think that is called a constructor? Why does one IDE not show that and another IDE will show that? Is that something I need to know about right away or can I just not worry about it when just starting out? I know that books don't have you type that in.
357mag is offline   Reply With Quote
Old Mar 26th, 2005, 3:42 PM   #2
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
templates IDE use are different depending on who wrote them. Netbeans adds a constructor for ease, because most classes will have a constructor. Eclipse doesn't because they figure you can ad one yourself. I'm pretty sure these templates are customizable, so if you don't like 'm you can change 'm. You'll need to know about constructors if you want to program in Object Oriented fashion, like with Java, or C++.
Dizz
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:57 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC