TestShirt - Shirt two = new Shirt...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
class Shirt { private double Collar; private int Sleeve; private String Material; Shirt(double c,int s, String m) { Collar = c; Sleeve = s; Material = m; } Shirt() { Collar = 17.5; Sleeve = 38; Material = "Cotton"; } public void setCollar(int c) { Collar = c; } public double getCollar() { return Collar; } public void setSleeve(int s) { Sleeve = s; } public int getSleeve() { return Sleeve; } public void setMaterial(String m) { Material = m; } public String getMaterial() { return Material; }} public class TestShirt { public static void main(String[]args) { Shirt one = new Shirt(20,40,"Cotton");
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Shirt two = new Shirt(); System.out.println("Constructor 1: Collar Size: " + one.getCollar()); System.out.println("Constructor 1: Sleeve Length: " + one.getSleeve()); System.out.println("Constructor 1: Material: " + one.getMaterial()); System.out.println("Constructor 2: Collar Size: " + two.getCollar()); System.out.println("Constructor 2: Sleeve Length: " + two.getSleeve()); System.out.println("Constructor 2: Material: " + two.getMaterial()); }}...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern