About 18,800,000 results
Open links in new tab
  1. How to Return a String in Java - Delft Stack

    Feb 2, 2024 · The return statement is simple and effective for fixed strings, StringBuilder is powerful for dynamic string manipulation, and String.format() provides a clean way to format …

  2. Returning String Methods in Java? - Stack Overflow

    Here's what I have: public static int randInt(int randomNum) //determines the random value for the day. Random rand = new Random(); randomNum = rand.nextInt((40000 - 1000) + 1) + 10000; …

  3. Java return Keyword - W3Schools

    Java Keywords. A method with a return value: Try it Yourself » The return keyword finishes the execution of a method, and can be used to return a value from a method. Tip: Use the void …

  4. String toString() Method in java with Examples - GeeksforGeeks

    Jul 1, 2018 · String toString () is the built-in method of java.lang which return itself a string. So here no actual conversion is performed. Since toString () method simply returns the current …

  5. How to Take & Return a String in Java - Know Program

    We have four ways to take and return string data as:- 1) char [] / byte [] 2) String 3) StringBuilder 4) StringBuffer The char [ ] is not a better option because it works on an array. Taking and …

  6. How to Return a String in Java: A Comprehensive Guide

    Oct 23, 2023 · Returning String values from methods is a vital skill for any Java developer. In this extensive tutorial, we will dig deep into the various ways to return Strings in Java.

  7. String (Java Platform SE 8 ) - Oracle Help Center

    The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a …

  8. Method to Take and Return String Data in Java - DZone

    May 1, 2020 · Is char [ ], String, StringBuffer, or StringBuilder the best way to take and return String data in Java? Take a look at this comparison.

  9. function to return a string in java - Stack Overflow

    Jan 25, 2012 · return String.format("%d:%02d", mins, secs); As you can see, I've pushed the variable declarations as far down as I could (this is the preferred style in C++ and Java). I've …

  10. Java Strings - W3Schools

    There are many string methods available, for example toUpperCase() and toLowerCase(): The indexOf() method returns the index (the position) of the first occurrence of a specified text in a …

  11. Some results have been removed
Refresh