Conjoint Gaming [Game On]

CG Technical Area => Programming => Topic started by: UnknownError on August 26, 2013, 07:47:01 PM

Title: Java Help
Post by: UnknownError on August 26, 2013, 07:47:01 PM
The Problem: Write code that will look at the number of characters in String m= "Look here!"; and then print

"Look Here!" has 10 characters.

Use the length method() to print the 10.... you must also force the two quotes to print.

What I have so far.
Code: [Select]
String m = “Look here!”;
int x = m.length();
System.out.print(“\"Look here!”\” )
System.out.print(
Title: Re: Java Help
Post by: TowerSheep on August 26, 2013, 07:55:49 PM
I won't give you the answer yet incase you want to figure it out. Message me on steam if you do want the answer. I will provide to helpful links

Things to look into:

The Java documentation on what can be done to strings:
http://docs.oracle.com/javase/6/docs/api/java/lang/String.html (http://docs.oracle.com/javase/6/docs/api/java/lang/String.html)

The methods of escape characters and what they do:
http://web.cerritos.edu/jwilson/SitePages/java_language_resources/Java_Escape_Sequences.htm
SimplePortal 2.3.5 © 2008-2012, SimplePortal