NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

- Heap/stack memory:
+ Stack: chứa method và biến cục bộ(biến tạm thời). Method đc gọi sẽ lưu vào stack, vào sau ra trước(LIFO). Nếu biến cục bộ là Object(Object luôn ở trên heap), thì trên stack chỉ là refer của nó (Object).
+ Heap: biến toàn cục ở trong Object, tất cả cả Object sống trong heap

- Super: nằm trong class con để gọi method của class cha khi được kế thừa. Constructors của class con luôn gọi Constructors của class cha (nếu k gọi super() thì sẽ đc complier tự động thêm vào)(Vì có muốn có con thì bắt buộc phải có cha)
super() luôn nằm ở dòng đầu tiên của Constructors.
Nếu Constructors của class cha luôn có arguments, thì Constructors của class con cũng phải có những arguments tương tự và phải gọi super() cùng những arguments đó theo đúng thứ tự.

- Local variable: Tồn tại trong khung của method trong stack. Chỉ sử dụng trong hàm được khai báo. Khi hàm đó kết thúc thì biến đó cũng k còn tồn tại trong stack nữa.
- Instance variables: Luôn nằm trong Object trên Heap. Nếu đó là reference variable nó vẫn nằm trong object nhưng mang giá trị null, khi gọi new XXX(), Heap sẽ tạo 1 object XXX mới và variable sẽ đc ref tới đó.
- Reference variable: Giá trị mặc định là null, khi gọi new thì sẽ đc ref tới object đó trong heap. Object trong heap tồn tại khi còn ít nhất 1 ref tới nó và sẽ đc GC dọn dẹp.
3 cách tạo ref var: khai báo new() và ref bằng toán tử =, khi ref đã tồn tại nhưng vẫn gọi = new XXX() thì sẽ đc ref tới object mới, object cũ sẽ bị bỏ rơi và được GC dọn dẹp. khi ref = null nếu trước đó đã ref tới object trong heap thì object đó sẽ bị bỏ rơi và được GC dọn dẹp
Nếu bạn sử dụng toán tử dấu chấm(".") trên một ref null, bạn sẽ nhận NullPointerException trong khi Runtime.
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.