What is an Operand Stack in Java?

0 votes
Please help me understand what is Operand stack in Java and how does it work? Your help will be appreciated.
Mar 6 in Java by Prachi
55 views

1 answer to this question.

0 votes

The basic utility of Operand Stack are as follows:

  • JVM uses operand stack as a work space like rough work. We can say for storing all the intermediate calculation’s result. Like we use a rough sheet to do our calculation.
  • Operand stack can also be looked as organized array of words like local variable array. Then again there is a catch, this is not accessed by using index like local variable array does, rather it is accessed by some instructions that can push and pop values to and from operand stack and perform required operations.
This is the use of Operand Stack in JVM. To visualize it better, think of a stack and imagine push and pop operation. In the push and pop operation instead of number or string there are instructions. That's Operand Stack.
answered Mar 7 by Priyaj
• 56,520 points

Related Questions In Java

+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,190 points
258 views
0 votes
1 answer

What is an efficient way to implement a singleton pattern in Java?

Use an enum: public enum Foo { ...READ MORE

answered Jul 6, 2018 in Java by Akrati
• 3,150 points
79 views
0 votes
2 answers

In Java, what is the best way to determine the size of an object?

I happened to find a java class "jdk.nashorn.internal.ir.debug.ObjectSizeCalculator", ...READ MORE

answered 2 days ago in Java by Sirajul
• 18,370 points
82 views
0 votes
2 answers

What is the use of toString method in Java and how can I use it ?

Whenever you require to explore the constructor ...READ MORE

answered Aug 23, 2018 in Java by Daisy
• 8,040 points
373 views
+5 votes
3 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,380 points

edited Nov 6, 2018 by Omkar 7,169 views
0 votes
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,050 points
1,813 views
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,050 points
4,728 views
0 votes
1 answer

Selenium JARS(Java) missing from downloadable link

Nothing to worry about here. In the ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,050 points
411 views
0 votes
4 answers

What is difference between access modifier and access specifier in java

Access Specifier:- This can be understood as ...READ MORE

answered Feb 14 in Java by Priyaj
• 56,520 points
2,501 views
+1 vote
2 answers

What is an Object?

Hey @preetiagarwal, your description is an answer ...READ MORE

answered Dec 24, 2018 in Java by Priyaj
• 56,520 points
40 views