Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is type casting?

Answer Posted / sitaram

casting means one type of date to another type of data.
There are two types
1.Implicit Type Casting.
2.Explicit Type Casting.

public class One {
static short i=10;
int k =i; //implicit
byte b = (byte)i;//Explicit
public static void main(String[] args) {
System.out.println("integer i..."+i);
}
}

1.Implicit Casting :
===================
The small data type will be automatically covert to big data
type.
Example:
static short i=10;
int k =i; //implicit
2.Explicit Casting:
===================
The big data type will be convert to small data type by type
casting.
Example:
static short i=10;
byte b = (byte)i;//Explicit

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between an object-oriented programming language and object-based programming language?

986


What is a hashmap used for?

1250


Why is stringbuffer faster than string?

923


What is array size in java?

961


What do you mean by light weight and heavy weight components?

1018


What is the difference between interface & abstract class?

1045


what is thread? : Java thread

985


What is hashing in java?

1041


Can singleton class be cloned?

1052


What is the difference between static class and normal class?

1032


What does string intern() method do?

1086


What are different types of multitasking?

960


Why vector is used in java?

1026


What does the @override annotation do?

1040


What is assembly condition codes?

990