19.09.2015 Views

Prentice.Hall.Introduction.to.Java.Programming,.Brief.Version.9th.(2014).[sharethefiles.com]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.8 Visibility Modifiers 317<br />

public class F {<br />

int i;<br />

static String s;<br />

}<br />

void imethod() {<br />

}<br />

static void smethod() {<br />

}<br />

(a)<br />

8.18 Add the static keyword in the place of ? if appropriate.<br />

public class Test {<br />

private int count;<br />

public ? void main(String[] args) {<br />

...<br />

}<br />

public ? int getCount() {<br />

return count;<br />

}<br />

public ? int fac<strong>to</strong>rial(int n) {<br />

int result = 1;<br />

for (int i = 1; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!