Results 1 to 2 of 2
- 10-30-2007, 07:28 PM #1
Member
- Join Date
- Oct 2007
- Posts
- 1
- Rep Power
- 0
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?
Java 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
- 10-30-2007, 08:09 PM #2
Yes, "information passing between the classes" looks good to me. But you should better to practice on Sun's code conventions.
Similar Threads
-
Passing Environment Variable in Eclipse Europa
By ajaymenon.k in forum EclipseReplies: 0Last Post: 11-19-2007, 10:08 AM -
system information
By nitinborge5 in forum New To JavaReplies: 1Last Post: 08-07-2007, 09:25 AM -
Variable passing, Error: IOException
By fernando in forum New To JavaReplies: 3Last Post: 07-31-2007, 02:03 PM -
Information about Struts
By Felissa in forum Web FrameworksReplies: 2Last Post: 07-02-2007, 04:40 PM -
Some information about Hibernate
By Marcus in forum JDBCReplies: 2Last Post: 07-02-2007, 04:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks