This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Solution { | |
| public void entry(int m, int n) { | |
| Step [] steps = new Step[(m - 1) + (n - 1) + 1]; | |
| steps[0] = new Step(0, 0); | |
| recur(m, n, 0, 0, steps); | |
| } | |
| public recur(int m, int n, int y, int x, Step [] steps) { | |
| if (y == m - 1 && x == n - 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class GeometryLesson { | |
| static double degreesToRadians (double d) { | |
| return (Math.PI / 360) * d; | |
| } | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyClass { | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void printEach (XXX items) { | |
| for (Object o: items) { | |
| System.out.println(o); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class Vehicle { | |
| abstract int wheelCount(); | |
| } | |
| class Automobile extends Vehicle { | |
| int wheelCount() { | |
| return 4; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| ... some code ... | |
| } catch (SomeType exception) { | |
| ... some code ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Perishable { | |
| int daysRemaining(); | |
| } | |
| class InventoryItem {} | |
| abstract class Produce extends InventoryItem implements Perishable {} | |
| class Fruit extends Produce { | |
| @Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Checksums { | |
| static String md5 (String input) { | |
| return ... | |
| } | |
| static String md5 (byte[] array) { | |
| return ... | |
| } | |
| static String md5 (InputStream is) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mycompany.marketing; | |
| interface PackageLevelInterface { | |
| void doSomthing(); | |
| } | |
| public class MyClass implements PackageLevelInterface { | |
| @Override | |
| /// IDE insists on this being public (?) | |
| public void doSomthing() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void dailyProcessingSetup() { | |
| try { | |
| ... | |
| } catch (Exception e) { | |
| log(e.getMessage()); | |
| throw new RuntimeException("exception logged in dailyProcessingSetup"); | |
| } | |
| } |
OlderNewer