Answer the question
In order to leave comments, you need to log in
Which code is faster, where the variable is static or is it passed in the method?
There are two codes... which one is faster?
class Main{
static MyClass myClass;
public static void main(String[] args) {
myClass = new MyClass();
example();
}
static void example(){
myClass.work();
myClass.flex();
}
}
//или же
class Main{
public static void main(String[] args) {
MyClass myClass = new MyClass();
example(myClass);
}
static void example(MyClass myClass){
myClass.work();
myClass.flex();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question