2021-01-01から1年間の記事一覧
参考資料 www.databaseanswers.org アンチパターン
ファインダーに絶対パスを表示 $ defaults write com.apple.finder _FXShowPosixPathInTitle -bool true ウィンドウのアニメーションを無効化 $ defaults write com.apple.finder AnimateWindowZoom -bool false Macで端っこまでスクロールさせた時に跳ねる…
ドメイン層の役割 ドメイン層は、 アプリケーション層に提供する業務ロジックを実装するためのレイヤとなる。 ドメイン層の実装は、以下3つに分かれる。 1.Entityの実装 業務データを保持するためのクラス(Entityクラス)を作成する。 2.Repositoryの実装 業…
問8復習 配列で存在しない要素に対してアクセスしようとした場合に 例外処理を実行する public class Main { public static void main(String[] args) { String[] array = {"A", "B", "C"}; System.out.println(array[3]); } } public class Main { public s…
例外処理の仕組み、考え方が身についていない。 わかったこと try-catch-finallyの順番で書かないとコンパイルが通らずコンパイルエラーになる 例外処理は万が一エラーが起きた場合に対する処理を書く、 Q例外処理が終わったら? A正常な処理に戻す
JUnit5でテストコードを書く package jp.co.sample; import static.org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; public class StringUtilsTest { //テスト名 @Test void isEmpty01() { //引数がnullの場合、trueが返却されるこ…
去年流行ったJavaで湯婆婆を実装してみる を参考に例外処理を実装する。 空文字に例外を投げることはできたが全角スペースを許容してしまう。 今回は全角スペースを許容もチェックする。 結論 trimメソッドを使って名前を入力した時点で全角スペースを除く処…
Main.java public class Main { public static void main(String[] args) throws Exception { String str1 = "apple"; String str2 = ""; boolean bool1 = str1.isEmpty(); boolean bool2 = str2.isEmpty(); System.out.println("bool1 : " + bool1); System…
Main.java public class Main { public static void main(String[] args) throws Exception { String str1 = "apple"; String str2 = ""; boolean bool1 = str1.isEmpty(); boolean bool2 = str2.isEmpty(); System.out.println("bool1 : " + bool1); System…
Main.java public class Main { public static void main(String[] args) throws Exception { String str1 = "apple"; String str2 = ""; boolean bool1 = str1.isEmpty(); boolean bool2 = str2.isEmpty(); System.out.println("bool1 : " + bool1); System…