0

I googled it and I found that it is virtual machine dependent. But still in what ways ?

7
  • 1
    something above 2.3 volts for TTL arch... Commented Jul 25, 2017 at 14:10
  • 3
    Not at that level, a more abstract answer would be fine.Boolean variable is of 2 bytes in some VM, so a justification of that would be more than enough. Thank you. Commented Jul 25, 2017 at 14:11
  • The Java spec makes no guarantees about anything like this. What JVM are you interested in? Hotspot? Commented Jul 25, 2017 at 14:13
  • In C, I used to create my own boolean types typedef int bool by defining 1 as true and 0 as false. So I think here is the same and it changes depending on the arch. Commented Jul 25, 2017 at 14:13
  • Sun Microsystems. Commented Jul 25, 2017 at 14:14

1 Answer 1

3

boolean type will be converted to int

There are no Java Virtual Machine instructions solely dedicated to operations on boolean values. Instead, expressions in the Java programming language that operate on boolean values are compiled to use values of the Java Virtual Machine int data type.

You can read more in JavaDoc

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.