| Author |
Additional Use for Parentheses.
|
Eden Landau
Ranch Hand
Joined: Aug 14, 2011
Posts: 40
|
|
Hello! I came across this bit of code the other day.
Can anyone tell me what role do the oddly placed parentheses in line 67 play?
Thank you all very much!
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
Do you mean this line?
The (JButton) is a type cast. It means that the compiler should treat whatever object e.getSource() returns as if it is a JButton object.
There's some information about type casting on this page from Oracle's Java Tutorials.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Eden Landau
Ranch Hand
Joined: Aug 14, 2011
Posts: 40
|
|
|
That solves it then! Thank you very much!
|
 |
 |
|
|
subject: Additional Use for Parentheses.
|
|
|