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

What is arrays fill in java?

947


What is serial version uid and its importance in java?

987


Explain the hierarchy of java exception classes?

1021


Why set is used in java?

952


What is the difference between length and length() method in java?

1054


Is empty string in java?

1094


Can a set contain duplicates?

902


What do you mean by constructor?

923


what is difference between equals and ==?

997


explain different ways of using thread? : Java thread

960


How to perform selection sort in java?

956


what is use of functional interface in java 8?

975


When throw keyword is used?

991


What is the synonym of procedure?

1012


What are the different ways of implementing thread? Which one is more advantageous?

938