logo

Java String ToString() Method


Show

Description

The toString() process returns the string depiction of the object. If you print any entity, the java compiler inside invokes the toString() process on the object.

Syntax

Here is the syntax of this method:

public String toString()

Parameters

Here is the detail of parameters:

  • NA

Return Value

  • It returns the String, converted to lowercase.

Example

import java.io.*;
public class Test {

   public static void main(String args[]) {
      String Str = new String("Welcome to Intellinuts.com");

      System.out.print("Return Value :");
      System.out.println(Str.toString());
   }
}

This will produce the following result:

Output

Return Value :Welcome to Intellinuts.com

Here at Intellinuts, we have created a complete Java tutorial for Beginners to get started in Java.