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.
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.
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?
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: 2816
2
posted
0
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
posted
0
Hi, I see it on the first post listing. Please check screenshot attached. Thanks!
Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 2816
2
posted
0
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.
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.