07.01.2013 Views

David Defour - Université de Perpignan

David Defour - Université de Perpignan

David Defour - Université de Perpignan

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Printf Example: Controlling Width<br />

and Precision<br />

public class CEO {<br />

private String name;<br />

private double salary; // In billions<br />

}<br />

564<br />

jeudi 26 janvier 12<br />

public CEO(String name, double salary) {<br />

this.name = name;<br />

this.salary = salary;<br />

}<br />

public String getName() { return(name); }<br />

public double getSalary() { return(salary); }<br />

Note that you cannot make a class with a “main” method in an Android app and run it from Eclipse in the<br />

usual way (R-click, Run As � Java Application). So, the printf and parsing examples are in a separate<br />

project called NetworkingSupport. This project also contains the servlet used in the second networking<br />

lecture.

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

Saved successfully!

Ooh no, something went wrong!