Ask your own question, for FREE!
Mathematics 18 Online
Directrix (directrix):

Do you know Java, please contact @DawnR .

OpenStudy (solomonzelman):

who is he?

Directrix (directrix):

Here's DawnR. Great.

OpenStudy (dawnr):

haha i am a person who needs some help with my "project" i'm making the snake game..and i needed to separate a class into new different classes but i have hard time trying to call methods from them into the previous one ..i explained some part in here http://openstudy.com/study#/updates/54a40046e4b0e4319f8f00d7 i can paste the code or upload it if anyone is willing to help :)

Directrix (directrix):

@DawnR I'll leave this thread open until another Java person comes along. I have yet to find any topic on which somebody here was not competent or thought so. lol

OpenStudy (dawnr):

thanks! :)

OpenStudy (dawnr):

nope just java :(

OpenStudy (anonymous):

I will be able to help later if no one gets to you by then. I know a wide range of programming languages such as Java, JavaScript, C#, VB, Python etc....

OpenStudy (dawnr):

well that is great! :D thank you! :) here is a part of my problem : http://openstudy.com/users/dawnr#/updates/54a40046e4b0e4319f8f00d7

OpenStudy (dawnr):

@Nnesha i don't need help with java script i need java

OpenStudy (anonymous):

I might be able to help later if no one gets to you by then. I know a wide range of programming languages such as Java, JavaScript, C#, VB, Python etc.... Java is no different than any other OOP langauge and is pretty good and Java was the first language that was used to build Android Apps with and you still can with Java

OpenStudy (dawnr):

well i am currently working in java so that's why i need only java :)

OpenStudy (dawnr):

with*

OpenStudy (anonymous):

IN your snake game are you using threads? Just wondering

OpenStudy (dawnr):

yes...

OpenStudy (dawnr):

but the issue is separating my class into more classes

OpenStudy (dawnr):

the program its self works ...just due to a better written code i need to separate it

OpenStudy (anonymous):

So you don't know how to write classes in separate files and then import your classes?

OpenStudy (dawnr):

no i know how to write them i just don't know how to call the methods from them because the attributes which those methods use are private...

OpenStudy (anonymous):

Also, what IDE are you using?

OpenStudy (dawnr):

netbeans

OpenStudy (anonymous):

I am asuming your classes have been added to you project so you should be able to just import myclass or import package.myclass Once you have your class imported, you can just call it from a public method inside that class that access the private method. MyClass myclass = new MyClass myclass.PublicAccessToPriviateMethod() Since your methods are private that means you can only access those methods with public getters and setter methods. Only the class methods can access the private methods so in that class you have to create public methods that accesses those private methods. Understand?

OpenStudy (anonymous):

Anyways, I can help more later if you do not get it by then. Good luck

OpenStudy (dawnr):

okay i will try to do it..i can send you the code if you want ..

OpenStudy (dawnr):

to see how it works..idk if i can quite explain what it does :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!