Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Java
« Previous
Next »
A lower precision can be assigned to a higher precision value in Java. For example a byte type data can be assigned to int type.
Options
- True
- False
CORRECT ANSWER : True
Discussion Board
java
true
sachin patel 02-8-2015 11:47 PM
Conversion from lower precision to higher precision
Conversion is what we call when trying to convert from one type to another type. It is possible to have lower precision value assigned to higher precision values. For example:
byte to short, int, long, float, or double
short to int, long, float, or double
char to int, long, float, or double
int to long, float, or double
long to float or double
float to double
Converting from one type to another type doesn't always result in loosing of the information but it can sometimes result in unexpected situations. For example: conversion of an int or a long value to float, or of a long value to double, may result in loss of precision.
Rohit Sharma 07-28-2014 03:39 AM
Value assignment in Java
In java, we can assign a byte into an integer, and integer into a long. But trying to assign to a variable of lower precision generates a compile time error.
Value assignment in Java 07-6-2013 01:29 AM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
Java Beginner (11)
Java (39)
Java (40)
Java (22)
Java (30)
Java (25)
Java (20)
Java (20)
Core Java (20)
Core Java (10)
Core Java (72)
EJB (20)
JDBC (20)
Applet (20)
Struts (21)
Servlets (20)
Java Web Services (20)
Javascript (40)
J2EE (10)
jQuery (46)
Advertisement
▲