Java - Write code to convert string to Lower Case using tenary operator

Requirements

Write code to convert string to Lower Case using tenary operator

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String str = "book2s.com";
        System.out.println(toLowerCase(str));
    }/*  w  ww . j a v  a2s  .co m*/

    public static String toLowerCase(String str) {
        return str == null ? null : str.toLowerCase();
    }
}

Related Exercise