Uploaded by Daniel Ephraim

CS 234 IS 292 Practical One

advertisement
CS 234 & IS 292: Practical One (Week 1 )
27th March, 2019
a) Write a Java program with the class name Pencil consisting of three instance
variables color, length and price. The instance variables must be initialized through
a parameterized constructor. The program has a single method called display which,
when invoked using an object of the Pencil class, displays the values of the
attributes associated with the pencil object.
Download