Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (6.5k points)
edited by
Could someone tell me how to use Java functions without instantiating?

1 Answer

0 votes
by (11.3k points)
edited by

We use static functions for this. This means that there are two ways of memory allocation for the elements of any JAVA program. The first category is static memory allocation (preemptive memory allocation) and the second category is dynamic memory allocation (memory allocation at execution). In static allocation, the memory is allocated to the method after compilation and we don't have to create an object for it to assign memory through an instance.

For example,

public static int stmemalloc()

Related questions

0 votes
1 answer
0 votes
1 answer
asked Oct 31, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...