The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
112 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.2k points) | 112 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.6k points) | 83 views
+1 vote
2 answers
2
0 votes
1 answer
3
0 votes
1 answer
5
asked Dec 15, 2017 in Programming by kallu singh Junior (935 points) | 56 views
0 votes
0 answers
7
asked Nov 16 in Operating System by kallu singh Junior (935 points) | 18 views


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

44,161 questions
49,645 answers
163,350 comments
65,809 users