+15

Confusion on the challenge question. finally or final keyword?

Here is one java challenge question in which asked that can we apply finally with Abstract Classes. Is it right? I know that variable, method and classes can be final but finally? https://www.sololearn.com/post/245605/?ref=app

2/17/2020 2:25:06 PM

AJ #Level 20 End Day

16 Answers

New Answer

+5

Jayakrishna and Avinesh Yes that's what I was thinking. Rest can be final but abstract class can't be final. Also we use finally with try catch block. So here should be final. Right? So here is typo mistake and also don't know how this approved.

+4

Avinesh finally always execute. Does not depend on exception.

+3

0_0 Mägár Sám Äkà Nüllpøïntêr Èxëcéptïön 'finally' is a keyword in Java which is used to execute a piece of code considering that the program might return an error or exception during execution.

+3

🅰🅹 - Pʀᴏᴅᴜᴄᴛ Mᴀɴᴀɢᴇʀ I know, just realized after posting 😅

+3

Avinesh 😂😂

+2

It may be approved on no.of likes only.. Once I find same type of question.. That make me confusion. So I make question this... https://www.sololearn.com/Discuss/2040901/?ref=app

+2

An abstract class is a prototype and design metric, not for any implementation in the main subroutine! 😒

+2

Avinesh OMG just for a moment i think finally as a finalize method. Thanks @Avinesh for remind me my mistake. So Confusing by the way😬.

+2

0_0 Mägár Sám Äkà Nüllpøïntêr Èxëcéptïön finalize use in garbage collector.

+2

🅰🅹 - Pʀᴏᴅᴜᴄᴛ Mᴀɴᴀɢᴇʀ finally I know that finally is not what I expect, but finally I'm able to understood that what finally really is.😬😁 o_O_0_o_O_0

+1

finally is not access modifier. So Should be final. I reported as typo.. A class can't be both final and abstract at same

+1

It should be final. Because as you said, the rest all can be final but we cannot use final with abstract classes.

+1

It should be 'final'. You can report the question.

+1

It is final key word it makes variable constant