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 type of value does sizeof return?

989


How does callback work in java?

1041


What is the difference between the boolean & operator and the && operator in java programming?

1017


Why constructor has no return type?

1093


Is java jre still free?

936


What is the difference between import java.util.date and java .util?

1036


What is instanceof keyword?

1199


What is the constructor?

1031


Give us a program to check for parenthesis matching using stack.

984


Can we call virtual funciton in a constructor ?

2180


Is java 9 released?

973


What is hashing in java?

1021


What is the collection interface?

1005


What are the different types of java?

1036


What is a priority queue java?

971