• Post Reply Bookmark Topic Watch Topic
  • New Topic

help fixing/explaining tampered program  RSS feed

 
Samuel Weston
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so im currently learning about importing from one program to another (I hope that's the right word-its 2 separate pages in eclipse is what I mean)
with one program holding all the information while the other executed the data into specific instances of the class.
all that I pretty much understood.
what I then wanted to do was reverse the process, making each program independent of the other-and able to run itself.

I did away with a number of commands (such as the keyword import ) but somewhere along the way I lost track of what to do next. im having trouble recognizing what necessary and what im missing. can you help?



the second program...

 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so im currently learning about importing from one program to another (I hope that's the right word-its 2 separate pages in eclipse is what I mean)

Do you mean passing data from one class to another class or do you mean one program that writes data to a storage medium (eg file, database etc) and another program that reads in that data.
what I then wanted to do was reverse the process, making each program independent of the other-and able to run itself.

Sorry, I'm really lost now. Rather than describing what you are trying to do in terms of modifications to an existing program please describe exactly what you want your new program to do as if you were telling a 5 year old.
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot import code like that. All the import keyword does is tell the compiler where to find a particular class or its static members.
you should not try to make classes independent of one another. A major part of object‑oriented programming is making classes which represent parts of the problem, and then putting then whole thing back together.

The code you posted won't compile, because you haven't matched your {s and }s. It would have been obvious if you had a consistent indentation policy.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!