|
HotJoe Java Help Forums
|
|
|
|
| Author |
Message |
|
|
Hi i need help with this saml java program i just dont understand
lol umm i wanted to be able to enter a couple of con objects like enterDouble(), enterChar(), enterString() and enterDate(). into this program.::
import tools.*;
public class ConsoleDemo {
public static void main(String[] args) {
// define and construct Console device
Console con;
con = new Console(true);
// example of entering an integer
int i;
con.prompt("Please enter an integer [0 to 10]");
i = con.enterInt();
con.display("The integer is: " + i + "\n");
// example of entering a double
con.prompt("please enter an integer [0 to 10]");
i = con.enterdouble();
con.display("The Integer is: " + i + "\n");
} // end main()
} // end class ConsoleDemo
i dont kno how to add on the above cons.
|
 |
|
|
Im having priblems with tis little program im writing. Im just a beginer and im so confused lol can some one plz help me.
Here's the program. i get errors with charAt()
equals(), equalsIgnoreCase(), length(), substring(). maybe if someoen could test the program they could understand better ?it says cannot resolve symbol - method equals ().
thnxs
public class StringDemo {
public static void main(String[] args) {
String s1;
String s2;
/*
* toUpperCase() converts the given
* String to upper-case
*/
String s3;
String s4;
/*
* toLowerCase() converts the given
* String to lower-case
*/
String s5;
String s6;
/*
* trim() converts the given
* String to trim
*/
String s7;
String s8;
/*
* equals() converts the given
* Sting to equals ()
*/
String s9;
String s10;
/*
* length() converts the given
* String to length ()
*/
String s11;
String s12;
/*
* substring() converts the given
* String to substring()
*/
String s13;
String s14;
/*
* equalsIgnoreCase() converts the given
* String to equalsIgnoreCase()
*/
String s15;
String s16;
/*
* charAt() converts the given
* String to charAt()
*/
s1 = "The quick brown fox jumps over the lazy dog.";
s2 = s1.toUpperCase();
s3 = "The quick brown fox jumps over the lazy dog.";
s4 = s3.toLowerCase();
s5 = "The quick brown fox jumps over the lazy dog.";
s6 = s5.trim();
s7 = "The quick brown fox jumps over the lazy dog.";
s8 = s7.equals();
s9 = "The quick brown fox jumps over the lazy dog.";
s10 = s9.length();
s11 = "The quick brown fox jumps over the lazy dog.";
s12 = s11.substring();
s13 = "The quick brown fox jumps over the lazy dog.";
s14 = s13.equalsIgnoreCase();
s15 = "The quick brown fox jumps over the lazy dog.";
s16 = s15.charAt();
System.out.println();
System.out.println("toUpperCase() Demo");
System.out.println("------------------");
System.out.println("The original string was: " + s1);
System.out.println("The new string is: " + s2);
System.out.println();
System.out.println("toLowerCase() Demo");
System.out.println("------------------");
System.out.println("The original string was: " + s3);
System.out.println("The new string is: " + s4);
System.out.println();
System.out.println("trim() Demo");
System.out.println("------------------");
System.out.println("The original string was: " + s5);
System.out.println("The new string is: " + s6);
System.out.println();
System.out.println("equals() Demo");
System.out.println("------------------");
System.out.println("The original string was: " + s7);
System.out.println("The new string is: " + s ;
System.out.println();
System.out.println("length() Demo");
System.out.println("------------------");
System.out.println("The original string was: " + s9);
System.out.println("The new string is: " + s10);
System.out.println();
System.out.println("substring() Demo");
System.out.println("------------------");
System.out.println("The original string was: " + s11);
System.out.println("The new string is: " + s12);
System.out.println();
System.out.println("equalsIgnoreCase() Demo");
System.out.println("------------------");
System.out.println("The original string was: " + s13);
System.out.println("The new string is: " + s14);
System.out.println();
System.out.println("charAt() Demo");
System.out.println("------------------");
System.out.println("The original string was: " + s15);
System.out.println("The new string is: " + s16);
} // end main
} // end class StringDemo
|
 |
|
|
|
|
|
|
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2012 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle
|