0

I'm starting to work with the android system and Java in general.

I'm coming from a VB background, and in VB I had a Module, that enabled me to write functions that were accessible from everywhere in my program(different pages for example)

Is there something similar to the Module of VB6 in Java and Android?

Thanks!

1 Answer 1

2

In Java you can set the visibilty of a function to public. Then you can access it from everywhere in your code, if you have a object of that class.

public void doSomething() {
}

Then you can also use the keyword static to define methods that do not need to be called from an object of that class but exists during the first loading of the class until the end of the programm:

public static void doSomething() {
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.