answersLogoWhite

0

public class StringLength

{

public static void main(String args[])

{

String firstString;

String secondString;

System.out.println("Please enter string (group of characters) ");

firstString=sc.nextString();

System.out.println("Please enter second string (group of characters) ");

secondString=sc.nextString();

if(firstString>secondString)

{

System.out.println(); //create blank line

System.out.println("First String is greater than the second string");

System.out.println();

}

else

{

System.out.println("Second string is greater than the first string");

System.out.println();

}

}//closes the main method

}//closes the class.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write a c program to copy two strings using pointers?

nahi malum


Write a program in 'C' language to accept 6 strings as input and print them in lexicographic?

(ab)*b


How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


Write a javascript program out of three no which one s greater?

1 2 3


Write a program to enter a character and it will tell the character etered?

{char a;...cout > a;cout


How do you write a C program to copy to strings using pointers?

mystrcpy (char* dest, char* src) { while ((*dest++ = *src++) != '\0); }


Should i added strings to my composition?

Yes, but only if you actually know how to write for strings.


Can program development be done by a program?

Yes and no, program development works in programming codes which are specifically made for humans to be entered, a program can write these programming codes too. The thing is, you would need to write the programming codes yourself before the program can use it in program development. If a program could invent the wheel, then you still need to invent that wheel before the program can. Or atleast until the thinking of the human brain can be translated into mere programming code.


How do you write talking strings in Cherokee?

syllabry


Write a program to accept 2 numbers and tell whether the product of the two number is equal to or greater than 1000?

C programm


Write javascript code to display a list of strings?

You need to put the strings in an array, and then loop through the array to output the strings. Something like this would be a simple example: ---------------- var strings = ["s1","s2","s3"]; for ( var i in strings ) { document.write( strings[i] ); }


Write a program which takes the gender and salary the age from user the program should calculate and display the following information you If gender is male and age is greater equals 18 then the tax?

Write a program which takes the gender and salary ,the age from user. the program should calculate and display the following information. i. If gender is male and age is greater >=18,then the tax =5%of the salary. ii. If gender is female and age is >=18,then tax=3%of salary. The program should display the output as follows: Gender = Age = Tax = Salary before tax = Salary after tax =