The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
96 views

class Value 

{

       public static void main(String [] s )

     {

     int i = 255;

byte b=(byte)i ;

char c = (char)b;

System.out.println("int value of char : " + (int) c);

}

 

}

 

 

asked in Programming by Active (5k points) | 96 views
0

what i think that if we keep on counting the values in the way 

128 integer value stands for -128 byte 

129 integer value stands for -127 byte .. 

but in this way it will take 15 minutes to solve if we will calculate like this.

Please tell how to solve quickly with a trick.

Please log in or register to answer this question.

Related questions

0 votes
0 answers
1
asked Apr 28, 2017 in Algorithms by Devshree Dubey Boss (12.3k points) | 76 views
+1 vote
2 answers
2
0 votes
1 answer
3


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

36,075 questions
43,521 answers
123,665 comments
42,747 users