Can a double value be cast to a byte?

Answer Posted / ravikiran(aptech mumbai)

yes
double d=22.55;
byte b=(byte)d;

Is This Answer Correct ?    34 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between length and length() method in java ?

657


What are the different types of java?

647


What is java life cycle?

624


What is stack class in java?

639


Have you ever used hashtable and dictionary?

672






What are the different ways of implementing thread? Which one is more advantageous?

629


What is linked hashmap and its features?

629


What is the difference between throw and throws in java?

643


What is pangram in java?

615


What is a treemap in java?

639


How do you calculate square roots?

675


What is string data?

650


What is the use of static class?

630


What are the data types supported by java?

638


Why does java have two ways to create child threads?

559