Hyroko
  • Hyroko
This doesn't seem to work. String stuff = "System.out.println("This is a string")"; System.out.print(stuff); note, I am NOT trying to print what the inside println is calling. I'm actually looking to print out THIS actual statement to the screen. System.out.println("this is a string"); I don't want this string to be evaluated as a method call. I want to literally print this statement.
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Hyroko
  • Hyroko
I'm using this so that I can test regex to look for valid names in a java document. and I'm trying to make my regex ignore all words inside of quotation marks and words inside of comments.
woodrow73
  • woodrow73
Hyroko, The parser gets a bit confused when you have quotes within quotes - to get quotes inside of a String, you have to place a special character before it called an escape character. In java, I think it's a backslash: \ ``` String stuff = "System.out.println(\"This is a string\")"; System.out.print(stuff); ``` that should work. Here are the other characters that can be 'escaped' in java: http://stackoverflow.com/questions/1367322/what-are-all-the-escape-characters-in-java
Hyroko
  • Hyroko
Thank you, yes, that worked.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

Hyroko
  • Hyroko
I'm working on making hash tables to hash all reserved words into one table, and all legal java names into another, whilst ignoring comments and strings.
woodrow73
  • woodrow73
Sounds like a fun program, good luck with it man
Hyroko
  • Hyroko
yeah, final project of the semester. relatively easy, just thinking about the Regex
Hyroko
  • Hyroko
Thank you

Looking for something else?

Not the answer you are looking for? Search for more explanations.