Choose Between Good And Evil
From Huben's Wiki
Line 1: | Line 1: | ||
+ | [[Image:Gandalf_nazgul.jpg]] | ||
+ | |||
Today we must face the difference between good and evil, between truth and falsity. We must learn to reason about them, lest we fall into error. The human sage George Boole was the great master in whose footsteps we follow. | Today we must face the difference between good and evil, between truth and falsity. We must learn to reason about them, lest we fall into error. The human sage George Boole was the great master in whose footsteps we follow. | ||
Line 15: | Line 17: | ||
<pre> | <pre> | ||
String s1 = "abcde"; | String s1 = "abcde"; | ||
− | String s2 = "elbereth" | + | String s2 = "elbereth"; |
String s3 = s1; | String s3 = s1; | ||
− | String s4 = " | + | String s4 = s1 + ""; |
char a = s1.charAt(4); | char a = s1.charAt(4); | ||
Line 32: | Line 34: | ||
boolean l = s1.equals(s4); | boolean l = s1.equals(s4); | ||
</pre> | </pre> | ||
− | Now make a test program that prints out each. Did you get them right? Why or why not? | + | Now make a test program that prints out each. Test programs only need a class with a main(). Did you get them right? Why or why not? |