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?

Answers were Sorted based on User's Feedback



What is type casting?..

Answer / 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

What is type casting?..

Answer / rakesh jain

Whenever u want to assign the value of one type variabel to
another type variable . in this case u must type cast
between them.
Generally there is two type of Type casting

1 Implicit Type Casting

2 Explicit Type Casting

example:=

short s=10;

int i=240;

s=(short)i; //Explicit type casting

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More Core Java Interview Questions

what is template design pattern?

0 Answers  


What is the difference between the >> and >>> operators?

1 Answers  


How do you use compareto?

0 Answers  


What is the reason that multiple inheritance is not possible in java??

1 Answers  


What are static methods?

0 Answers  


Is java 11 paid version?

0 Answers  


What is super in java?

0 Answers  


What is the difference between throw and throws?

11 Answers   IBM,


Explain the difference between abstract class and interface in java?

0 Answers  


Is minecraft 1.15 out?

0 Answers  


What is the ResourceBundle?

2 Answers   Elementus Technologies,


How do you control extraneous variables?

0 Answers  


Categories