Answers for "string in java"

14

formartted string java

String str = String.format( "Hello \n World \n my name is %s and i'm %d years old" , "Paul", 27);
Posted by: Guest on March-08-2020
14

how to reverse a string in java

public class ReverseString {
    public static void main(String[] args) {
        String s1 = "neelendra";
        for(int i=s1.length()-1;i>=0;i--)
            {
                System.out.print(s1.charAt(i));
            }
    }
}
Posted by: Guest on March-14-2020
8

how to make a string java

String newString = "Hello World";
Posted by: Guest on September-12-2020
5

declare String in java

String stringName = "your string content";
Posted by: Guest on May-29-2020
1

string method example in java

public boolean equalsIgnoreCase(String s)
------------------------------------------
String x = "Exit"; 
System.out.println( x.equalsIgnoreCase("EXIT")); // is "true" 
System.out.println( x.equalsIgnoreCase("tixe")); // is "false"
Posted by: Guest on January-25-2020
0

String in java

private String hello = "Hello world!";
//or
private String anotherHello = new String("Hello world");
Posted by: Guest on November-13-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language