presentation11 - nal and static Soheil Hassas Yeganeh...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
fnal and static Soheil Hassas Yeganeh Computer Engineering Department ShariF University oF Technology
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
fnal 2
Background image of page 2
fnal Marks as write once read many (constant). fnal felds . fnal local variables . fnal methods !? 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
fnal felds 3 Test.java class Test { final int i = 0; final int j; Test(){ j = 1; } }
Background image of page 4
fnal felds When a feld is marked as fnal you cannot change it aFter the initialization . A fnal feld must be initialized when defned , or in the class constructor . (Blank) 3 Test.java class Test { final int i = 0; final int j; Test(){ j = 1; } }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
fnal felds errors (1) 4 Test.java class Test { final int j; Test(){ } }
Background image of page 6
fnal felds errors (1) What are the errors oF this program? 4 Test.java class Test { final int j; Test(){ } }
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
fnal felds errors (2) 5 Test.java class Test { final int j; Test(int k){ if( k > 0) j = k; } }
Background image of page 8
What are the errors oF this program? 5
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/21/2010 for the course COMPUTER S 003 taught by Professor Izadi during the Spring '10 term at Amirkabir University of Technology.

Page1 / 18

presentation11 - nal and static Soheil Hassas Yeganeh...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online