25.02.2017 Views

java_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Java<br />

Example<br />

import <strong>java</strong>.io.*;<br />

public class Test{<br />

public static void main(String args[]){<br />

String Str = new String("Welcome to Tutorialspoint.com");<br />

System.out.println("Hashcode for Str :" + Str.hashCode() );<br />

}<br />

}<br />

This will produce the following result:<br />

Hashcode for Str :1186874997<br />

Java – String indexOf(int ch) Method<br />

Description<br />

This method returns the index within this string of the first occurrence of the specified<br />

character or -1, if the character does not occur.<br />

Syntax<br />

Here is the syntax of this method:<br />

public int indexOf(int ch )<br />

Parameters<br />

Here is the detail of parameters:<br />

<br />

ch -- a character.<br />

Return Value<br />

<br />

See the description.<br />

158

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!