title: C# "is" operator alternative in Java
body: <p>in C# when I want to know if an object is an instance of a particular type or not, I can use "is" operator:</p>
  
  <pre><code>String foo = "hi :)"
  if (foo is String) ...
  </code></pre>
  
  <p>how can I do it in java? (I know I can use try statement, any other way?)</p>