Results 1 to 3 of 3
- 03-17-2008, 07:27 PM #1
Member
- Join Date
- Mar 2008
- Posts
- 3
- Rep Power
- 0
public declaration ('undeclaring')
This is probably more simple than the title, but here goes:
I have a class file that created VarClass as a public class.
public class VarClass
//{main{stuff}}
It compiles and works fine. But if I try to make, say, version 2 of it with the same named public class, javac simply says it should be declared in the first class. So my questions are: 1:doesn't it take ram space to remember that? and 2: how can i clear the computer of remembering. And if its a file that has to be edited, how can I tell java to do that?
I've heard of garbage collecting but I'm still learning so thanks.
- 03-17-2008, 08:37 PM #2
Change the name of the version_2 class or remove the version_1 source file from the current directory or put it into another folder in the current directory. Java cannot deal with multiple files with the same public, outer class_name in the same folder at compile time.
The garbage collector functions during runtime to remove objects from the jvm (java virtual machine) after there are no more references to them (the objects).
- 03-17-2008, 08:50 PM #3
Member
- Join Date
- Mar 2008
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Class is public, should be declared in a file
By goldhouse in forum New To JavaReplies: 7Last Post: 05-10-2012, 09:17 AM -
why we use public access modifier?
By vichet in forum New To JavaReplies: 1Last Post: 04-04-2008, 07:04 AM -
Public Holidays (Australia)
By oranjeBoven in forum Advanced JavaReplies: 0Last Post: 02-13-2008, 08:14 AM -
Public class variable
By Java Tip in forum Java TipReplies: 0Last Post: 12-03-2007, 09:58 AM -
public method
By dirtycash in forum New To JavaReplies: 4Last Post: 11-21-2007, 07:29 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks