CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

Nope....


[Replies] [Reply] [View by Thread] [Help]
[Back To SNEAK Development Forum]

Posted by Ret. Gen D-Cypell On 2005-02-26 19:14:49
In Reply to RE: Java - Backwards - Second Draft Posted by Lt dopel On 2005-02-26 16:51:44

Ret. Gen
Ret. Gen D-Cypell



You have put the null pointer back. str = null will give you null pointer on the first line.

On 2005-02-26 16:51:44, dopel wrote
> Maybe?
>
>

>public static String Backwards(String str){

>      str = str.trim();

>      if(str == null || str.equals("")){

>        //Probably should throw some type of exception here

>        return "";

>      }

>

>      StringBuffer newString = new StringBuffer(str);

>      return newString.reverse().toString();

>}

>



Replies:


Guest:
Subject:
Message:
Signature:
Optional Image Link:
http://

CyberArmy::Forum v0.6
Generated In 0.02286 seconds


About Us | Privacy Policy | Mission Statement | Help