Package exercises.models

Examples of exercises.models.Flower


  public void r_1_7() {
   
    System.out.println( "Q: Write a Java class, Flower, that has three instance variables of type String, int, and float, which respectively represent the name of the flower, its number of pedals, and price." );
    System.out.println( "A: " );
   
    Flower flower = new Flower( "Petunia", 5, 1.35 );
    System.out.println( flower );
   
    System.out.println( "\nUsing setters to alter values" );
    flower.setName( "Orchid" );
    flower.setNumberOfPetals( 20 );
    flower.setPrice( 50 );
    System.out.println( flower );
   
  }
View Full Code Here

TOP

Related Classes of exercises.models.Flower

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.