Create a class called book defines properties title

Assignment Help Basic Computer Science
Reference no: EM13892648

Please paste all of your code into this Word document and submit a single Word document for your solution.  Please enter your answers in bolded or a different color font, so they're easy to find - thanks!  Note that the PowerPoint and the MSDN website resource on Object-Oriented Programming for this week might be helpful.

1. Create a class called Book defines properties Title, Author and Year.  Add a method called Display() that outputs the Title and Author

2. Create a class called BookTest that uses an object initializer to create an object of class Book (from step 1) and initialize all of its properties.  Note: you will need to create a constructor method to do this 

Answer the following in essay form: 

3.Before adding a constructor method, describe what is called when we create an instance of type Book?

A: Constructors are uncommon routines used to introduce types and make occasions of types. A type constructor is utilized to instate static information in a type. A type constructor is called by the common language runtime (CLR) before any occurrences of the type are made. Type constructors are static (Shared in Visual Basic) and can't take parameters. A case constructor is utilized to make examples of a type. Occasion constructors can take parameters, yet are not required to do as such. An occasion constructor without any parameters is known as a default constructor.

4. What concept would we be practicing if we created two new constructor methods?

A: New constructor method create a new function in java

5. Why is it important to use exception handling?

A: Exception handling is important for handling exceptions in the program. We can easily handle them by using try catch blocks.

6.What's the purpose of private vs. public when we're adding new properties and/or methods to our class?  How does this apply to information hiding?

A:  PRIVATE

Visible to the class only (private).

Methods, Variables and Constructors that are declared private can only be accessed within the declared class itself.

Private access modifier is the most restrictive access level. Class and interfaces cannot be private.

Variables that are declared private can be accessed outside the class if public getter methods are present in the class.

Using the private modifier is the main way that an object encapsulates itself and hide data from the outside world.

PUBLIC

Visible to the world (public).

A class, method, constructor, interface etc declared public can be accessed from any other class. Therefore fields, methods, blocks declared inside a public class can be accessed from any class belonging to the Java Universe.

However if the public class we are trying to access is in a different package, then the public class still need to be imported.

Because of class inheritance, all public methods and variables of a class are inherited by its subclasses.

7. What is composition?  How could we use Composition in our Book class?

A: In the visual arts-in unique painting, image design, images, and sculpture-composition is the placement or association of visual factors or constituents in a work of art, as particular from the field of a piece. It can be proposal of because the institution of the elements of artwork in step with the principles of art.

The term composition manner 'putting together,' and can observe to any work of art, from track to writing to images, that's organized or put collectively utilizing mindful inspiration. In the visible arts, composition is ordinarily used interchangeably with various phrases such as design, form, visual ordering, or formal structure, depending on the context. In photo design for press and desktop publishing composition is probably known as web page layout.

8. What is data abstraction?

A:Data abstraction is one of the principle of object oriented programming. It is used to display only necessary and essential features of an object to outside the world.Means displaying what is necessary and encapsulate the unnecessary things to outside the world.Hiding can be achieved by using "private" access modifiers.

Reference no: EM13892648

Questions Cloud

Arctic cat''s current ratios compare to their industry : Key figures for the recent two years of Polaris and Arctic Cat follow.
Business risk and high financial risk : What industry has both high business risk and high financial risk?
Incorporate at least two research university of phoenix : Incorporate at least two research University of Phoenix library sources
What elements of your culture influence these schemas : What shortcuts (schemas, heuristics) did you use to form your inferences? How did these shortcuts help or hinder your decision-making process? What elements of your culture influence these schemas? Would a person from a different culture draw on a ..
Create a class called book defines properties title : 1. Create a class called Book defines properties Title, Author and Year.  Add a method called Display() that outputs the Title and Author 2. Create a class called BookTest that uses an object initializer to create an object of class Book (from step 1..
Multitude of differences with risk level : When investing in bonds, there are a multitude of differences with risk level, time to maturity, and specific provisions, etc. One such provisional feature is known as a sinking fund.
What standards should be used to establish a fair wage : What standards should be used to establish a fair wage? Or, what factors determine what someone deserves for wages? How would you describe the managerial philosophy of Walmart?
Identify logistics management strategies of zara : Identify logistics management strategies that enable Zara to become so successful - How can Zara maintain its competitive advantage, here the concept of sustainability may be introduced?
What attributes do you apply to these groups : Into what groups do you place people you meet? What attributes do you apply to these groups? What does the environmental context have to do with your initial impression

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd