takaryo1010
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Java対策 ###### tags: `School` ## ラムダ式 - 一般にプログラミング言語で,名前のない関数(無名関数,匿名関数)をその場で定義したもの - 関数型インタフェースのメソッドをその場で定義し,それによってできるクラスのインスタンスを直ちに生成 ``` 型名1 引数名1, ..., 型名n 引数名n) -> { ... } (引数名1, ..., 引数名n) -> { ... } 引数名1 -> { ... } () -> { ... } ``` ## ストリーム - ある単位のデータの要素の連続的な列を表現したもの - 要素を受け取るたびに処理することで徐々に処理を進めることをストリーム処理という - list.stream()or bReader.lines() ### 中間操作 - list.stream().filter(name -> name.length() <= 4).toList() ## HashMap - 3つの中で一番高速 - map.put(key,value) - map.remove(key) ## ラッパークラス - 頭文字大文字 - 基本型はp - らっぱーはw - **オートボクシング** 基本型からラッパー - **アンボクシング** ラッパー型から基本型 - こいつらのおかげで自動変換があるから書かなくておけ - ボクシング(boxing) 参照型化 ## ジェネリクス - 型をパラメータとするクラスを作成する仕組み ``` class クラス名<型パラメータのリスト> { ... } ``` ## ArrayList - 可変長配列 - 末尾での要素の挿入,削除が速い - スタック(LIFO) - 深さ優先 ## LinkedList - アレイリストよりかは遅い - 先頭,末尾での要素の挿入,削除が速い - キュー(FIFO) - 幅優先 ## 制約充足問題 - 制約条件の集まりとして問題をモデル化 ## 生成検査法 - 全部作ってみる - 遅い、絶対だめ ## バックトラック法 - 制約に矛盾したらそれ以降の実行をおこわなわず、別の探索まで戻る(枝刈り) ## カプセル化 - クラスの一部のフィールドやメソッドをプログラムの特定の範囲のみで使うようにすること - フィールドを、外部から使えないようにすることが多い ## アクセス制御 ![image](https://hackmd.io/_uploads/H1y90mqKa.png) - カプセル化のためにprivate - サブクラス(同一ファイル内)protected - 外部に公開するメソッド public ## アクセサ - getter - setter ## トップレベルクラス - 一番外側のクラスのこと(継承とかしてない) - 逆に内側のクラスを**ネストされたクラス(入れ子クラス)** - 外部クラス名.入れ子クラス名 ## 共有と**副作用** - プログラムの複数の箇所で同一のオブジェクトが参照されているとき,オブジェクト(への参照)は共有されているという - メソッドを呼び出す前後で,呼び出し元(または相当する箇所)のオブジェクトの内部状態に変更が生じることを副作用と呼ぶ - 共有されてるときに、共有先で値が変更されるかもしれない(参照するだけではなく変更する可能性があり、意図しないバグを生みやすい) ## 不変性と可変性 - オブジェクトの内部状態は生成したときに決める - その後は変更できなくする(カプセル化したものに近い) - 変更できなくする(privateやprotected)ことをしなかったら、それは可変 - 不変にすると、副作用を防げる - setterを外部から使えなくすることによって、変更を防ぐ ## レコード - Recordのサブクラスrecord - 不変なオブジェクトのクラスになる ``` record レコード名(ヘッダ) { ... } ``` ## ローカル変数 - ブロック内({})に宣言した変数 - 他のメソッドから見れない、一時的な変数のイメージ ## var(ローカル変数型推論) - var識別子で、null以外の初期値からいい感じの型を選んでくれる - 動的型付けではないため、一度型を推論したら他の型を入れることはできない ## 書き方の原則 - ガイドライン的なものだからさすがにでない気がする - 軽く目を通せばおけ

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully