I need help with JAVA homework.?
"i have java homework that i am not sure how to do, i mean i have most of it done but need a little help completing it. below is the directions my professor gave us that we have to follow."
"Please refer to JAVA API Specification(API WEBSITE) and find the "String" Class. Write an application and try to use eight different methods of the String class as was demonstrated in class. (examples: selecting portions of a string, manipulating strings such as changing all characters to uppercase or lowercase, counting the length of a string, etc)"
"This is what i have done below"
public class String
public static void main(String args[ ] )
Scanner input = new Scanner(System.in );
System.out.print( " Please enetr some text: ");
String txt = input.nextLine();
System.out.println( " you entered: " + txt);
System.out.println("the length of the text is: " + txt.length() ) ;
System.out.println( "After change: " );
System.out.println( txt.replace("God", "Allah") );
System.out.println( "After lower case change: " );
System.out.println( txt.toLowerCase() );
System.out.println( "After Upper case change: " );
System.out.println( txt.toUpperCase() );
"every time i compile i am getting an error message and also can someone help me complete the rest of this. I have to turn this in within 10 hours. THANK YOU"
Re: I need help with JAVA homework.?
i'm not 100 sure, but i think the problem is you calling the class "String"
change it to something different than java's reserved words, like "StringWork" or something
|All times are GMT +5.5. The time now is 21:03.|