minor changes
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -30,7 +30,7 @@ public class Distance {
|
||||
x2 = scan.nextDouble();
|
||||
System.out.print("Enter y2 coord: ");
|
||||
y2 = scan.nextDouble();
|
||||
|
||||
|
||||
scan.close();
|
||||
|
||||
double distance = Math.sqrt(Math.pow((x2 - x1), 2)
|
||||
|
||||
@@ -34,8 +34,10 @@ public class FunWithStrings {
|
||||
// Very clean code here -- checkstyle
|
||||
int len = trimmedBook.length();
|
||||
String upperFirst = trimmedBook.substring(0, 1).toUpperCase();
|
||||
String middleLow = trimmedBook.substring(1, len - 1);
|
||||
String middleLow = trimmedBook.substring(1, len - 1).toLowerCase();
|
||||
String upperLast = trimmedBook.substring(len - 1, len).toUpperCase();
|
||||
System.out.printf("Finally: %s\n", upperFirst + middleLow + upperLast);
|
||||
|
||||
// scan.next() returns the next token
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user