Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-30-2007, 08:28 PM
Member
 
Join Date: Oct 2007
Posts: 1
zen_to_go is on a distinguished road
Passing variable information between classes
This code works, I just want to know if the structure is good or bad?
I want to know your opinions on the best way to pass variable results
between classes.

If I write a class that calculates tax etc and I want to pass that result to another class to be used in an array or another calculation should I do it like this?




Code:
public class totalMe { private static String word; /** * @param args * @param word */ public static void main(String[] args) { smallSum sm = new smallSum(); System.out.print(sm.TheWord(word)); } } class smallSum{ public String TheWord(String word){ word ="did it work?"; return word; } }


Thanks for your time ---

ZTG
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-30-2007, 09:09 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Yes, "information passing between the classes" looks good to me. But you should better to practice on Sun's code conventions.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Environment Variable in Eclipse Europa ajaymenon.k Eclipse 0 11-19-2007 11:08 AM
system information nitinborge5 New To Java 1 08-07-2007 10:25 AM
Variable passing, Error: IOException fernando New To Java 3 07-31-2007 03:03 PM
Information about Struts Felissa Web Frameworks 2 07-02-2007 05:40 PM
Some information about Hibernate Marcus Database 2 07-02-2007 05:26 PM


All times are GMT +3. The time now is 10:31 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org