This week's book giveaway is in the
General Computing
forum.
We're giving away four copies of
Arduino in Action
and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Could compile but not able to run
Siva kandasamy
Ranch Hand
Joined: Dec 31, 2002
Posts: 139
posted
Jan 05, 2004 19:06:00
0
hi there,
See the code below.
I could able to compile but not able to run.
Getting the following error.
java
TestBed$Tester
Tester: Undefined variable
//: c08:TestBed.java // Putting test code in a static inner class. class TestBed { TestBed() { System.out.println("Object created"); } void f() { System.out.println("f()"); } public static class Tester { public static void main(String[] args) { TestBed t = new TestBed(); t.f(); } } } ///:~
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24081
15
I like...
posted
Jan 05, 2004 20:06:00
0
java TestBed$Tester
Tester: Undefined variable
Your shell is trying to expand "$Tester" as a UNIX shell variable. You need to escape the special '$' character with a '\', like
java TestBed\$Tester
[Jess in Action]
[AskingGoodQuestions]
Siva kandasamy
Ranch Hand
Joined: Dec 31, 2002
Posts: 139
posted
Jan 06, 2004 08:03:00
0
Thank You Ernest.
-siva
I agree. Here's the link:
http://aspose.com/file-tools
subject: Could compile but not able to run
Similar Threads
Static
Could not get this!!
why doesnt this compile?
Overriding Private Methods
Confusion with Constructor
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter