Java - Write code to Wrap given string token with double quotes.

Requirements

Write code to Wrap given string token with double quotes.

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String str = "book2s.com";
        System.out.println(doubleQuote(str));
    }//from  w  w  w  .  j a  v  a 2s.  c o m

    /**
     * Wrap given string token with double quotes.
     * 
     * @param str
     * @return a string token wrapped around with duble quotes
     */
    public static String doubleQuote(String str) {
        return ((str == null) ? null : "\"" + str + "\"");
    }
}