wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Strange Vector3(double, double, double) symbol not found? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Strange Vector3(double, double, double) symbol not found?" Watch "Strange Vector3(double, double, double) symbol not found?" New topic
Author

Strange Vector3(double, double, double) symbol not found?

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590




javac QuaternionConverter.java

where I have set the CLASSPATH to ./

Why are there such errors?
Thanks
Jack
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6




Notice that it says it can't find the method. It's not complaining about not finding a class or not finding a constructor.

That means you're trying to invoke a method like:


Seems you're confusing methods and constructors. Go back and review the relevant sections of your text or tutorial, and post again if it doesn't become clear.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Did you mean to write: return new Vector3(...) (you forgot the "new" keyword)?

Note: Why are you using float literals, such as 0.0f, instead of double literals, without the f? Your member variables are doubles anyway.

You have unnecessary casts also, to cast your float literals to double. Just write it like this: return new Vector3(1.0, 0.0, 0.0);
No need to use float literals or cast.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Sergii Trotsenko
Greenhorn

Joined: Oct 23, 2012
Posts: 6
What I can see is that you are defining parameter called _x in constructor and then doing x = x. You forgot about "_" . Seems this is the problem
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7542
    
  18

Sergii Trotsenko wrote:What I can see is that you are defining parameter called _x in constructor...

@Jack: And just on that point; I believe that's a C++ or Python convention (maybe others too), but it's generally frowned on in Java. Fields of any kind should start with a lower-case letter; and even though the language does allow you to do otherwise, you'll get funny looks from old farts like me if you do.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 2991
    
    9
Sergii Trotsenko wrote:What I can see is that you are defining parameter called _x in constructor and then doing x = x. You forgot about "_" . Seems this is the problem

Um, where? I don't see any x = x. I see x = _x, which works fine.
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 2991
    
    9
Winston Gutkowski wrote:@Jack: And just on that point; I believe that's a C++ or Python convention (maybe others too), but it's generally frowned on in Java. Fields of any kind should start with a lower-case letter; and even though the language does allow you to do otherwise, you'll get funny looks from old farts like me if you do.

To be fair, this isn't a field of any kind; it's a parameter.

I have occasionally seen individual shops that use a convention like this, even in Java. Either it's applied to all local variables and params, or it's applied to all fields. Unfortunately I've seen both conventions, which is annoying when the whole point is to distinguish between fields and local vars or params.

Jack: I'm pretty sure your problem has nothing to do with this. Instead focus on what Jeff hinted at, which is what Jesper explicitly pointed out.
Sergii Trotsenko
Greenhorn

Joined: Oct 23, 2012
Posts: 6
Hi, I see it on the first post listing. Please check screenshot attached. Thanks!



[Thumbnail for 1.png]

Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 2991
    
    9
Wow, that's strange. I see it really clearly as

(In case that comes out different for you, all three assignments are of the form var = underscore + var.)

I see that Jack edited this message exactly once, just a few minutes after it was first posted. Jack, is it possible this your edit was changing "x = x" to "x = _x"? That wouldn't explain how Sergii can still see it, but it might be a useful clue if something weird is going on with how posts are being retrieved.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

That you don't see the underscore in front of the x, that's a bug in the JavaRanch forum software! I see it also (I'm using Chrome).
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37985
    
  22
I can inspect the text of the post and there is definitely an underscore before the x. I could also see, unfortunately, that the indenting uses a combination of tabs and spaces. That is a very effective way to have your code look really peculiar on somebody else’s computer. You should always use spaces.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Strange Vector3(double, double, double) symbol not found?
 
Similar Threads
C++ class to Java
Enum example from Java Language Specification does not compile.
Syntax for mapping a var to a method
inheritance and access modifiers
Please Explain (Hashcode)