There are three ways to convert a String to float primitive in Java
parseFloat(),
valueOf() method of Float class and
new Float() constructor. Suppose you have String which represent a floating point number e.g. "3.14" which is value of PIE, you can convert it to float by using any of those three method. Since String is one of the most prominent data type in Java, you will often find yourself converting
String to Int, Double and other data types and vice-versa. Java designer knows about that and they have made arrangement to carry out these basic task in a predictable and consistent manner. Once you know the trick to convert String to float, you should be able to convert
String to Integer, Double and Short. BTW, converting String to byte array is little bit tricky because String is text data and bytes are binary, so character encoding comes into picture. If you want to learn more about how to do conversion between String and byte array, see this
step by step tutorial for String to byte array.