Mirka Ignjatovic

Greenhorn
+ Follow
since Mar 09, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mirka Ignjatovic

Well, is seems the problem is that I invoked javac from d:\ when Java is on c drive installed.

If I make same folder on C drive, it works.

So, I cannot still find my java file using classpath when I try from D drive.
Hi Megha,

All strings created here are created in String pool.

String name; //name is not initialized
String newName = "Nick"; //"Nick" created in String pool, newName refer it
newName = "Jason"; //"Jason" created in String pool
//newName refer to "Jason", reference to obj "Nick" lost
name = "Frieda"; //"Frieda" created in String pool
//name refer to "Frieda"
String newestName = name; //newestName refer to Frieda
//name and newestName refer to Frieda
name = null; //name reference is null, newestName still refer to Frieda

//at this moment, only reference to Nick is lost, so this object is elegible for GC
I have problem finding java files. I have Windows XP.
File A.java is in d:\test folder, and it is not in a package.

I tried (from d:\):
javac -classpath test A.java
javac -classpath \test A.java
javac -classpath test \A.java

I gor error: cannot read: A.java

javac test\A.java works

Does anyone has idea what can be the problem?
ok, name changed.
Book is SCJP study guide exam 310-055 from K&B.
Question was, what -classpath has to do with searching for *.java files
classpath = "path of *.class"
Chapter 10, question 10.

cd /foo
javac -classpath /foo/bar/biz/bing:/foo/bar MyClass.java

answer: Java file will be found in /foo/bar/biz/bing

What do classpath has with location og Java file?
Is it only for looking for class files that MyClass.java needs?