Online Java Compiler By
JavaTpoint.com
public class JavaByteToStringExample3 { public static void main(String[] args) { Byte byte1=110; //converting the byte value to long String str=byte1.toString(); //calling String class methods int index=str.indexOf(1); //returns the index within this string of the first occurrence of the specified character System.out.println(index); } }
Output