The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
110 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 (5.1k points) | 110 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 (13.5k points) | 78 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

39,717 questions
46,751 answers
140,565 comments
58,410 users