Categories
5G Network
Agile
Amazon EC2
Android
Angular
Ansible
Arduino
Artificial Intelligence
Augmented Reality
AWS
Azure
Big Data
Blockchain
BootStrap
Cache Teachniques
Cassandra
Commercial Insurance
C#
C++
Cloud
CD
CI
Cyber Security
Data Handling
Data using R
Data Science
DBMS
Design-Pattern
DevOps
ECMAScript
Fortify
Ethical Hacking
Framework
GIT
GIT Slack
Gradle
Hadoop
HBase
HDFS
Hibernate
Hive
HTML
Image Processing
IOT
JavaScript
Java
Jenkins
Jira
JUnit
Kibana
Linux
Machine Learning
MangoDB
MVC
NGINX
Onsen UI
Oracle
PHP
Python
QTP
R Language
Regression Analysis
React JS
Robotic
Salesforce
SAP
Selenium
Service Discovery
Service Now
SOAP UI
Spark SQL
Testing
TOGAF
Research Method
Virtual Reality
Vue.js
Home
Recent Q&A
Feedback
Ask a Question
Can we cast an int value into byte variable? what will happen if the value of int is larger than byte?
Home
JAVA
Can we cast an int value into byte variable? what will happen if the...
asked
Jan 24, 2020
in
JAVA
by
rahuljain1
Q:
Can we cast an int value into byte variable? what will happen if the value of int is larger than byte?
#java-variable
Answer
▼ Show
1
Answer
0
votes
answered
Jan 24, 2020
by
SakshiSharma
Yes, we can cast but int is 32 bit long in java while byte is 8 bit long in java so when you cast an int to byte higher 24 bits are lost and a byte can only hold a value from -128 to 128.
JAVA
Learn More with Madanswer
Related questions
0
votes
Q: What is variable in java?
asked
Oct 11, 2020
in
JAVA
by
SakshiSharma
#variable-in-java
#java-variable
+1
vote
Q: What will this return 3*0.1 == 0.3? true or false?
asked
Jan 24, 2020
in
JAVA
by
rahuljain1
#java-variable
0
votes
Q: What is the default value of byte variable?
asked
May 18, 2020
in
JAVA
by
AdilsonLima
#java
+2
votes
Q: In a class implementing an interface, can we change the value of any variable defined in the interface in Java?
asked
May 31, 2020
in
JAVA
by
SakshiSharma
#java-class-implementation
#java-class-interface
#class-interface-java
0
votes
Q: What are the Variables in Java
asked
Mar 29, 2020
in
JAVA
by
rajeshsharma
#java-variable
#variable-java
0
votes
Q: What is the default value of int variable?
asked
May 18, 2020
in
JAVA
by
AdilsonLima
#java
+1
vote
Q: Difference between a = a + b and a += b ?
asked
Jan 24, 2020
in
JAVA
by
rahuljain1
#java-variable
...