Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Java
»
Beginning Java
final variable name might not have been initialized with try/catch
kri shan
,
Ranch Hand
Sep 10, 2016 00:09:53
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
It shows variable name might not have been initialized with try/catch in the constructor and without try/catch is fine.
public class Student { private final String name; public Student() { [b] try { name = "Jim"; } catch(Exception e) { }[/b] } public void test() { String person = name; } }
Ganesh Patekar
,
Bartender
staff
Sep 10, 2016 00:59:25
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Old
thread
may help you --->
final variable try/catch dilemma
and IBM link --->
Is that your final answer?
Post by:
autobot
Do you want ants? Because that's how you get ants. And a tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
This thread has been viewed 1465 times.
Similar Threads
Unmarshalling JSON using Jackson when no default constructor is present in inner class
Constructor Issue
function- boolean
can the following code produces Null pointer exception?
NullPointerException - could somebody explain why ?
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:52:44
.