Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


[java] intermediate question (I think)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 ARCHIGAMER   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2000 - 02:33 PM

When I create a package for a java does it have to be compiled and distrubuted with the program or u just usethe import statement and thats the end of it. I wish there was a button on my monitor to turn up the intellegince. Theres a button called 'brightness' but it doesn't work

Sponsor:

#2 joeG   Members   -  Reputation: 172

Like
Likes
Like

Posted 02 October 2000 - 03:38 PM

Think about this: if you didn''t distribute your package with your app and called import com.your_package.* then where would the Java interpreter find your pacage? It''s no where on the client''s machine, and as far as I know the only way to have an app on one machine and the package on another is if you are writing an applet.

So, I would assume that you have to distribute your packages along with your app. Bummer considering how easy it is for people to decode those .class files.

Oh well.



joeG



#3 joeG   Members   -  Reputation: 172

Like
Likes
Like

Posted 02 October 2000 - 03:44 PM

But you can write a little bit of code to implement a customized class loader that would load classes from a network connection, or some other encrypted source, or...whatever situation you''re in.

I''ve never messed with subclassing java.ClassLoader but I''m sure there''s a bunch of tutorials out there that could help you out.

It doesn''t seem like an optimal solution though, so you may just be stuck with sending the packages with your application



joeG



#4 bobbin   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2000 - 09:47 PM

Packages serve to group together a collection or _related_ classes. If you don''t define a package name then all classes in that file belong to a default unnamed package, so you can''t really get away with having no packages.
The import statement is just there to save time including all the classes from a package (i.e. i can say import java.io.* so i don''t have to define like: java.io.File file i can say File file).
You don''t need the package directive, but when running your code you need to just call the class name (normally java packageName.className)

Why are some developers so concerned with mashing up their byte code? Do you really care if someone can open up your class, infact this is ment to be this way so that reflection classes can get method/structure information on run-time class instances! Hay I can open .exe/.com filez with debug + i know asm, does this mean that its unsafe?? NO course it don''t! You can make any code in any language unsecured by doing stupid things (like hard coding keys etc.)....

#5 ARCHIGAMER   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2000 - 10:43 PM

i was just wondering if it had to be included or not. I am not afraid

I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS