Placeholder Image

字幕列表 影片播放

  • >>Teacher:Tell me what is the difference between Class and Object in Java?

  • >>Student:A class is something you take 3 times a week in a semester, like Java Programming

  • Class. It is boring, but we have to take it.

  • >>Teacher:Then what is an Object? Can we NEW an object from a class, like we NEW a dog

  • named Lucky in a Dog class?

  • >>Student:An Object is something you can buy. If you want to create an object, you have

  • to be God to do so.

  • >>Teacher:When you write Java Programs you are the God in this program, you create Lucky

  • from a class called Dog.

  • >>Student:Are you sure? What if I want to create $1000 dollar bill from a class called

  • Money?

  • >>Teacher:Yes you can, but you can only spend the money you created in this Java program.

  • >>Student:That is pretty sad if my Lucky can only live in this program, and my $1000 dollar

  • bill can only be spent here. No exception allowed?

  • >>Teacher:Exceptions? Well, if you Try, you may Catch exceptions, and Finally you may

  • become a successful programmers with lots of real world money and a pet named Lucky!

  • >>Student:Really? But I think it may be easier to Inherit the money from my Dad, and Extend

  • it into mine.

  • >>Teacher:But what if the Cnstructor think you owe them too much money and force you

  • to do Garbage Collection for them?

  • >>Student:No way, I will use my Private Method and my Superclass will take care all these

  • mess. If they don't, I just Crash and Exit with zero value!

>>Teacher:Tell me what is the difference between Class and Object in Java?

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

A2 初級

Java類有人嗎? (Java Class anyone?)

  • 333 19
    馬育海 發佈於 2021 年 01 月 14 日
影片單字