The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
76 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 Boss (6.6k points) | 76 views

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 in Algorithms by Devshree Dubey Veteran (10.8k points) | 59 views
+1 vote
2 answers
2


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

29,961 questions
37,632 answers
96,400 comments
35,286 users