Login    New User    Forgot Password    Help      

Returning String

Java Tutorials

Example

class s
{
public String toString()
{
return "Using return statement for string ";
}
}
class s2
{
public static void main(String args[])
{
s ob=new s();

System.out.println(ob);
}
}

Output
















































Java Tutorials