Java - Write code to convert a string to To Not Null value, using conditional operator

Requirements

Write code to convert a string to To Not Null value

A not null value of a string is ""

Hint

You can use the conditional operator.

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String s = "book2s.com";
        System.out.println(ToNotNull(s));
    }//from w w w. j  a  v  a2  s  .com

    public static String ToNotNull(String s) {
        return s == null ? "" : s;
    }
}