Okay, in Java programming we have a variable days of the string datatype. So how do we write the variable with these string data type, we can do something like this stream. And then we can do let's see, variable name will be c, w equal Hallo? Ah, we're okay then I can print out these w here. Okay that I run, run project. Okay, hello, string data files string variable is actually a variable that is storing all these tests test message to all these messages.
So, if we want to say store these tests we use these string string variable string datatype to store this test value and we can also do something like this W dot k we have a law method here. We can do a dot equal to dot spray then.to string.to uppercase okay let's let me pregnancy okay is opening up because our w equal to w.to upper case. Okay we can use our law of all these methods in this string, data type is string variable. Tr I will also want to highlight this string data type. So the first character is a capital letter. So we can use a law for this function for these string data type, C for other kinds of variables, let's say dabba dabba C, D, equals zoo, zoo.
The Doc, there will not be any function or metaphors to use. If we want to use the function or method we have to change these da W to capital D. Okay, the first caretta Dabba to capital D. And then we can now have all These are functions or method to use. So we can do something d dot two dot two three. k, d dot two three means that we are converting from RSA dabba dabba datatype to string data type II. So for other data type like integer, integer, I see q equals zero, Q dot there won't be any method or function to access we can do something like BK and like I say in this data, we can change this integer to something like, integer, integer Q equals zero. Now we can have access to all these functions.
Also q.to string is more commonly used screen time to Okay, so if let's see, as we can see here if I say we want to convert from double integer, or float data type to a string data type, we can do something like this and then we put dot two three. Okay, then all these variables here will be our string datatype. If we want to do the other way, want to convert that string to, let's say, double, integer or the float. We can do something like this. We are usually the most commonly one They'll be integer, though. Pass integer, then I have a string, let's see.
Char Okay, maybe it's not so let's see, I put integer c equal integer dot pass integer chart. So this chart is actually a string I make more clear. So string three u equal chop okay I want to convert string to the integer data type I can do something like this. Okay then I have these string data type converter to this integer data type. Let's see If I want to convert to other data type, I just change this integer to let's say, double to float. This is how we convert from let's say, string to double or integer or float or D the other way, from Java to string, integer to string, and then fro to string.
So, these are important because let's say we do some calculation a string as a string new equal chop and stream i equal 30. Then the stream result equal, you promise Hi. He will give us Something very different okay i praying the result and we can see. So he gave me a one to one tree. So when in string I say you press I, it means that we pull this string together, we join these two strings together. If we want to do all those our calculation, we will have to convert this string to integer string to Java.
So, we have to do something like something like this. So, Java you let's say you one equals da ba, da pass cover Then you then Dabba high to a no pass ah Hi, Dan are we have these results double e u one I two k maybe I put this one also. Then the result will be the 3d print. Here we run and then run project and now we have 25. So we have a child process that is equal to 25. So, as we can see the data is actually very important in this Java programming If we want to do all these arithmetic or this calculation or this mess calculation, we have to convert a string to a double string to integer string to float.
Before we do all those calculation, if you want to just joy to test together then we can convert I say from dabber to string and then and then we try to string together. So, data types and the conversion actually very important idea that will be all for this session.