Java type casting

Java type casting

What is Downcasting ?
View Answers

October 27, 2010 at 5:50 PM

Hi,

Here is the answer,

Casting is nothing but data type conversion. Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy.eg: double to byte, long to int etc.

Up casting is the conversion of data type from lower range data type to higher data type eg: int to long, byte to long, int to double etc...

Thanks.









Related Tutorials/Questions & Answers:
type casting - Java Beginners
type casting and conversion  I am beginner and my query is Importance of type casting and conversion  Hi friend,public class TypeCasting...://www.roseindia.net/java
Java Type Casting - Java Beginners
Java Type Casting  what is object type casting? give some example with related
Advertisements
Java type casting
Java type casting  What is Downcasting
Java type casting
Java type casting  Can a Byte object be cast to a double value
type casting
type casting  what is type casting
java type casting problem - Java Beginners
java type casting problem  what is type casting? what is the type of type casting? explain with example?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/beginners/TypeCasting.shtml
Type casting in java
Type casting in java In this section you will learn about type casting in java. Type casting is to convert one type to another type. Java support two types... a double type cast to int type    Reference type casting : In java type
Type casting
Type casting  how to type cast a string value to byte array
type casting
type casting  <--bean class-->method calllist is of object type... List (object type) <Object> totalList(int pi){ (adsbygoogle = window.adsbygoogle || []).push({}); try{ Query q= em.createQuery
type casting
type casting  int n=20; n=sizeof((char)(float)n); what is n value
type casting purpose
type casting purpose  what is type casting , could u explain with practical example
ModuleNotFoundError: No module named 'type-casting'
ModuleNotFoundError: No module named 'type-casting'  Hi, My Python... 'type-casting' How to remove the ModuleNotFoundError: No module named 'type-casting' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'type-casting'
ModuleNotFoundError: No module named 'type-casting'  Hi, My Python... 'type-casting' How to remove the ModuleNotFoundError: No module named 'type-casting' error? Thanks   Hi, In your python
Type casting the returned value of a method.
Type casting the returned value of a method.  Hi, How do you type cast the returned value of a method so that you can avoid creating a temporary...) will be of type OnOffButton. I want to avoid: OnOffButton btn = (OnOffButton
Casting in java - Java Beginners
Casting in java   Hi, I want to know Casting in detail... is implicit casting and Explicit casting . Implicit casting : Ex - assign... Explicit casting : Ex - Assign superclass variable to subclass
Casting (Type Conversion)
casting. In java one object reference can be type cast into another object reference. This casting may be of its own type or to one of its subclass or superclasss... Casting (Type Conversion)      
What is casting?
What is casting?   Hi, What is casting? thanks
eraser type generics in java
eraser type generics in java  Explain eraser type generics in java with example
PHP Type Juggling
Type Juggling In PHP: Unlike other programming languages like C,C++ and Java... a float value to a variable then it becomes float type and if we assign... type, but if we add one integer and one float type variable then the result
methods type - Java Beginners
methods type in Java  Give me an example programs of methods types in Java
Reference type Vs Object type. - Java Beginners
Reference type Vs Object type.  Can anyone explain the exact.... They never contain the object. C++ object variables may be either, but Java supports only object references. For Example : Book bookvar = new Book("Java
different type input in java
different type input in java  hiiiii... get input different different type like as DataInputStream,Scanner i want to get source code of these all type of input method. thank   Java Read through DataInputStream: import
Getting A File's Mime Type In Java
Getting A File's Mime Type In Java  Getting A File's Mime Type In Java
Type Conversion - Java Beginners
Type Conversion   Hai, rajanikanth, Please explain how to convert from integer value to a string value .In a database operation i want to convert it.   hi jagadish Suppose int num = 10; String id = ""+num
How to Type in japanese in java Textfield?
How to Type in japanese in java Textfield?  Hello Sir/madam; Am creating an application in java in which i want to get a japanese String input from user.User needs to type in japanese in the textField.but I dont know how to type
Data type in java
Data type in java In this section we will tell you about data type in java. A data type is defined as " type of data that can be stored in variable". Java is a statically-typed language that means before using the variable
objective type question - Java Beginners
objective type question  Hi, Thakns for properly reply,I want to core java objective programming question plz let me url of this problem Thanks Ragini  You can find in www.javafaqs4u.com  
What type of programming language is Java?
What type of programming language is Java?  Hi, What type of programming language is Java? Why anyone should learn Java? What is Java and what features? Thanks   Hi, Java is Object Oriented, platform independent
object retun type - Java Beginners
object retun type  Hi, i have to create a method which should have return type of object . The object should contain 'list of filenames' array and a boolean field 'isVal'. Can anybody help
Date type typecasting - Java Beginners
Date type typecasting  Can i type cast Date object of java.util.* to java.sql.* Date Object? if so how? Refer to the following url http.... Date.parse gives you a result of type java.util.Date.Unfortunately for JDBC you need
java- jdbc with type 4 driver
java- jdbc with type 4 driver  My program code is----- import java.sql.*; import java.lang.* ; import java .io.*; import java.util.*; import...*; import java.lang.* ; import java .io.*; import java.util.*; import
Array list in Java - arraylist type error
Array list in Java - arraylist type error  I am using Array list in Java but when i compile i get array list type error. Can anyone please explain what is array list type error and why it occurs
Does the object type known during compilation in Java?.
Does the object type known during compilation in Java?.  class A { } class B extends class A { } class checkType { public static void main(String[] args) { A ObjA = new B();/// Here ObjA is of type A--> this fact
java method return type : - Java Beginners
java method return type :  i have one question regarding methods,,, if we create a method with return type as class name (public employee addemp(int,int))what should be its return type.....and if any know this pls explain
Which JDBC Type Using - Java Beginners
Which JDBC Type Using  As there are 4 types of JDBC driver. I wanted to know: How would one come to know that which jdbc type any web application is using (if Db is oracle or mysql or MSSQL)? Thanks, Sushma  Hi
one attribute of type int - Java Beginners
one attribute of type int  hi friends can anyone help me... attribute of type int to represent a month (1 for January, 2 for February, and so... function that returns the next month as a value of type month. Test your
Java Error In comapitable Type in statement - Java Beginners
Java Error In comapitable Type in statement  Here I want to Check wheter entered id is already Exists in Database or Not with Access Database, Plz Help Me Sir import java.io.*; import java.awt.*; import javax.swing.
Java File content type
Java File content type In this section, you will learn how to get the content type of the specified file. Description of code: This is essential part of the file. In various applications, there is a use of content type. Here we
process of compiling and running java program
process of compiling and running java program  Explain the process of compiling and running java program. Also Explain type casting
Java Get Mime Type
Java Get Mime Type       To get the mime type, we have defined FileNameMap interface... includes all the mechanism to map between a file name and mime type string
How to Create any type of Reports in Java - Java Beginners
How to Create any type of Reports in Java  Hello Sir ,How I can create any type of Reports like Crystal Reports etc(Student Result Report) in Java Application,plz Help Me Sir
Java error illegal start of type
Java error illegal start of type       The Java error illegal start of type... start  type, for this we have a class name Illegalstartoftype.Inside
Java get File Type
Java get File Type       This section illustrates you how to get the file type. In the given...) of class JFileChooser returns the file type.  ADS_TO_REPLACE_1    
Java program to get data type of column field
Java program to get data type of column field       In this example java program we have to get the data type of the database table fields. For this purpose we have established
What is the return type of execute mehtod in jdbc - Java Beginners
What is the return type of execute mehtod in jdbc  Hi Deepak, u posted this answer. " Whatever it may be the statement type, like.... " String s="raja" , Here return type of s is string
type mismatch
type mismatch  Statement s= con.createStatement(); this line gives error of "type mismatch" I am using eclips nd new to servlet nd JDBC, Please help me, Thank you
Java example program to get Operating System type or architecture
Java example program to get Operating System type or architecture       java get OS type In java environment we can write java code which will make us enabled to get
data type
data type  which data type is used to store video file in mysql databse
Maven dependency for org.opendaylight.mdsal.binding.model.iana - iana-if-type version 10.0.3 is released. Learn to use iana-if-type version 10.0.3 in Maven based Java projects
- iana-if-type version 10.0.3 in Java projects. Follow the step by step tutorial...; org.opendaylight.mdsal.binding.model.iana - iana-if-type version 10.0.3 java...; - Version 10.0.3 of iana-if-type released The developers of  
Maven dependency for org.opendaylight.mdsal.binding.model.iana - iana-if-type version 9.0.2 is released. Learn to use iana-if-type version 9.0.2 in Maven based Java projects
-if-type version 9.0.2 in Java projects. Follow the step by step tutorial...; org.opendaylight.mdsal.binding.model.iana - iana-if-type version 9.0.2 java library...; - Version 9.0.2 of iana-if-type released The developers of  

Ads