Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 16
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
14 Respostas
+ 6
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.
+ 5
Avinesh finally always execute. Does not depend on exception.
+ 4
An abstract class is a prototype and design metric, not for any implementation in the main subroutine! š
+ 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 šš
+ 3
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š¬.
+ 3
š
°š
¹ - 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
+ 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
0_0 MƤgĆ”r SĆ”m ĆkĆ NĆ¼llpĆøĆÆntĆŖr ĆxĆ«cĆ©ptĆÆƶn finalize use in garbage collector.
+ 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