Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Cercle
- {
- private double rayon;
- static void bob(double r)
- {
- rayon=r;
- }
- static void bob()
- {
- rayon=3.45;
- }
- public double perimetre(){
- return 2*Math.PI*rayon;
- }
- public static void main(String[] args){
- Cercle c1 = new bob(6.1);
- Cercle c2 = new bob(2.7);
- Cercle c3 = new bob();
- System.out.printf("%f\n", c1.perimetre());
- System.out.printf("%f\n", c2.perimetre());
- System.out.printf("%f\n", c3.perimetre());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement