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 03-17-2008, 08:27 PM
Member
 
Join Date: Mar 2008
Posts: 3
Jadellll is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-17-2008, 09:37 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,022
hardwired is on a distinguished road
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).
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-17-2008, 09:50 PM
Member
 
Join Date: Mar 2008
Posts: 3
Jadellll is on a distinguished road
I deleted the text file and class file, but it still remembers that it should be initialized in a different file/class. I want to know where it remembers it, so I can clear it if I need to. Creating a new name for class is a workaround. I want to actually clear it.
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
why we use public access modifier? vichet New To Java 1 04-04-2008 08:04 AM
Public Holidays (Australia) oranjeBoven Advanced Java 0 02-13-2008 09:14 AM
Public class variable Java Tip Java Tips 0 12-03-2007 10:58 AM
public method dirtycash New To Java 4 11-21-2007 08:29 PM
Class is public, should be declared in a file goldhouse New To Java 1 08-09-2007 07:36 PM


All times are GMT +3. The time now is 07:46 AM.


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