Your SlideShare is downloading. ×
  • Like
Exercice sur les classes en Java
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Exercice sur les classes en Java

  • 242 views
Published

Exercice qui permet de mettre en pratique les notions acquises en Java en ce qui a trait avec les Class.

Exercice qui permet de mettre en pratique les notions acquises en Java en ce qui a trait avec les Class.

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
242
On SlideShare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
5
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Les Classes en Java Exercice sur les classe ING. David Joseph
  • 2. Formation Chez-Nous Ateliers initialisation et approfondissement en informatique www.wikinfosysteme.azurewebsites.net/fcn Wiki Info Systeme | ING. David Joseph | 3/20/2014 1 Soit la classe POINT : public class Point { private double X ; private double Y ; public Point(double valueX, double valueY) { This.X=valueX ; This.Y=valueY ; } public setX(double valX) { This.x=valX ; } public setY(double valY) { This.Y=valY ; } double void getX() { Return thix.X ; } double void getY() { return this.Y ; }
  • 3. Formation Chez-Nous Ateliers initialisation et approfondissement en informatique www.wikinfosysteme.azurewebsites.net/fcn Wiki Info Systeme | ING. David Joseph | 3/20/2014 2 string void coordonne() { return ‘’(‘’+this.X+’’,’’+this.Y+’’)’’ ; } } Travail a faire: I- Completer a) Identifier les variables de classe:________________________________________________ b) Identifier les variables static :__________________________________________________ c) Identifier le ou les constructeur :_______________________________________________ d) Identifier les mutateurs :_____________________________________________________ e) Identifier les ascenceurs :_____________________________________________________ II- Trouver le resultat de ces commandes a) Point Origine=new Point(0.0,5.3) ; b) Origine.setX(2.3) ; c) Origine.getX() ; d) Origine.coordonne() ; III- Ecrire les commandes qui pourront determiner la distance entre deux points definis tels que : Point X1, X2 ; X1=new Point(8.0, 7.4) ; X2= new Point(5.0, 0.0); Remarque la distance entre deux points: (AB)2 =(XB-XA) + (YB-YA), AB est la distance desiree.