How to Convert String to Boolean in Java

This Class file take input from the console and convert that into Boolean, This code will be useful when we read Test data from either excel or JSON as String and implement that in Code for CheckBox and Radio Button to select /unselect

import java.util.Scanner;

public class StringToBoolean


public static void main(String[] args){
    convertStringtoBoolean ();
 public static  void  convertStringtoBoolean(){

        System.out.println("Enter true or false in diff case");
        Scanner in = new Scanner(;

        String enteredValue = in.nextLine();
        //Can Enter "True","false","False","FALSE","TRUE" 
        Boolean isbool =enteredValue.equalsIgnoreCase("true");