How will you measure that int takes up only 32 bits in memory?

Answers were Sorted based on User's Feedback



How will you measure that int takes up only 32 bits in memory?..

Answer / umesh naik

System.out.println(Integer.SIZE);

it will print 32

System.out.println("Float.SIZE "+Float.SIZE);

it will print 32

System.out.println("Long.SIZE "+Long.SIZE);

it will print 64

Is This Answer Correct ?    0 Yes 0 No

How will you measure that int takes up only 32 bits in memory?..

Answer / sachin tyagi

by using random function which never generate value more
than 32 bits.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Core Java Interview Questions

Which variables are stored in heap?

0 Answers  


Java Compiler is stored in JDK, JRE or JVM?

0 Answers  


Where is stringbuffer stored?

0 Answers  


for(i=0;i<100;i++) { int i=method();//method returns no's from 1 to 10; /* insert some stmts which can give output like no.of times numbers(1-10) returned. (for example if it returns 2 then i want output how many times 2 returned) like that i want output for no's 1 - 10 how many times each no returned. */ }

3 Answers  


Why runnable interface is used in java?

0 Answers  


What is lossy conversion in java?

0 Answers  


Why does java not support pointers?

0 Answers  


Can I declare a class as private?

0 Answers  


Why all programming languages have main as a execution starting point?

4 Answers  


What is a stringbuilder?

0 Answers  


What is the difference between abstraction and encapsulation?

0 Answers  


How many statements can be created with one connection in jdbc?

4 Answers   Polaris,


Categories