What is the relationship between an object and class in an OOP program?


The object contains classes.

The object and class are the same thing.

The object is used to create a class.

The object in a program is called a class.

Answers

Answer 1

Answer:

D. The object in a program is called a class.

Explanation:

Java is a object oriented and class-based programming language. It was developed by Sun Microsystems on the 23rd of May, 1995. Java was designed by a software engineer called James Gosling and it is originally owned by Oracle.

In object-oriented programming (OOP) language, an object class represents the superclass of every other classes when using a programming language such as Java. The superclass is more or less like a general class in an inheritance hierarchy. Thus, a subclass can inherit the variables or methods of the superclass.

Basically, all instance variables that have been used or declared in any superclass would be present in its subclass object.

Hence, the relationship between an object and class in an OOP program is that the object in a program is called a class.

For example, if you declare a class named dog, the objects would include barking, color, size, breed, age, etc. because they are an instance of a class and as such would execute a method defined in the class.


Related Questions

What is media framing?

Answers

Answer:

media frame all news items by specific values, facts, and other considerations, and endowing them with greater apparent for making related judgments

Explanation:

The Fast as Light Shipping company charges the following rates. Weight of the item being sent Rate per 100 Miles shipped 2kg or less. $0.25 Over than 2 kg but not more than 10 kg $0.30 Over 10 kg but not more than 20 kg. $0.45 Over 20 kg, but less than 50kg. $1.75 Write a program that asks for the weight of the package, and the distance to be sent. And then displays the charge.

Answers

Answer:

weight = float(input("Enter the weight of the package: "))

distance = float(input("Enter the distance to be sent: "))

weight_charge = 0

if weight <= 2:

   weight_charge = 0.25

elif 2 < weight <= 10:

   weight_charge = 0.3

elif 10 < weight <= 20:

   weight_charge = 0.45

elif 20 < weight <= 50:

   weight_charge = 1.75

if int(distance / 100) == distance / 100:

  d = int(distance / 100)

else:

   d = int(distance / 100) + 1

   

total_charge = d * weight_charge

print("The charge is $", total_charge)

Explanation:

*The code is in Python.

Ask the user to enter the weight and distance

Check the weight to calculate the weight_cost for 100 miles. If it is smaller than or equal to 2, set the weight_charge as 0.25. If it is greater than 2 and smaller than or equal to 10, set the weight_charge as 0.3. If it is greater than 10 and smaller than or equal to 20, set the weight_charge as 0.45. If it is greater than 20 and smaller than or equal to 50, set the weight_charge as 1.75

Since those charges are per 100 miles, you need to consider the distance to find the total_charge. If the int(distance / 100) is equal to (distance / 100), you set the d as int(distance / 100). Otherwise, you set the d as int(distance / 100) + 1. For example, if the distance is 400 miles, you need to multiply the weight_charge by 4, int(400/100) = 4. However, if the distance is 410, you get the int(400/100) = 4, and then add 1 to the d for the extra 10 miles.

Calculate the total_charge, multiply d by weight_charge

Print the total_charge

when you look directly at a camera lens, it may seen like there is only one lens, but entering light actually passes through a series of lenses, or_____, that bend the light and send it on its way to be focused on the film or digital. chip

Frame
Optics
Flash
SD cARD

Answers

Answer:

The answer should be optics...

Explanation:

If aa person is known to have look at a camera lens straight and light passes via a number of lenses, or Optics.

What is Optics?

This is known to be an aspect  of physics that looks at the attributes and properties of light, such as its relationship with matter, etc.

Therefore,  If a person is known to have look at a camera lens straight and light passes via a number of lenses, or Optics.

Learn more about Optics from

https://brainly.com/question/18300677

#SPJ9

Mark is a stockbroker in New York City. He recently asked you to develop a program for his company. He is looking for a program that will calculate how much each person will pay for stocks. The amount that the user will pay is based on:


The number of stocks the Person wants * The current stock price * 20% commission rate.


He hopes that the program will show the customer’s name, the Stock name, and the final cost.


The Program will need to do the following:


Take in the customer’s name.

Take in the stock name.

Take in the number of stocks the customer wants to buy.

Take in the current stock price.

Calculate and display the amount that each user will pay.

A good example of output would be:

May Lou
you wish to buy stocks from APPL
the final cost is $2698.90

Answers

ok sorry i cant help u with this

most of the answers for this test is wrong.

Answers

Answer: C, Showing professional behavior.

Explanation:

Consider the following method.


public int locate(String str, String oneLetter)

{
int j = 0;
while(j < str.length() && str.substring(j, j+1).compareTo*oneLetter < 0)
{
j++;
}
return j;
}

Which of the following must be true when the while loop terminates?

a. j == str.length()
b. str.substring(j, j+1) >= 0
c. j <= str.length() || str.substring(j, j+1).compareTo(oneLetter) > 0
d. j == str.length() || str.substring(j, j+1).compareTo(oneLetter) >= 0
e. j == str.length() && str.substring(j, j+1).compareTo(oneLetter) >= 0

Answers

Answer:

All

Explanation:

From the available options given in the question, once the while loop terminates any of the provided answers could be correct. This is because the arguments passed to the while loop indicate two different argument which both have to be true in order for the loop to continue. All of the provided options have either one or both of the arguments as false which would break the while loop. Even options a. and b. are included because both would indicate a false statement.

During TCP/IP communications between two network hosts, information is encapsulated on the sending host and decapsulated on the receiving host using the OSI model. Match the information format with the appropriate layer of the OSI model.

a. Packets
b. Segments
c. Bits
d. Frames

1. Session Layer
2. Transport Layer
3. Network Layer
4. Data Link Layer
5. Physical Layer

Answers

Answer:

a. Packets - Network layer

b. Segments - Transport layer

c. Bits - Physical layer

d. Frames - Data link layer

Explanation:

When TCP/IP protocols are used for communication between two network hosts, there is a process of coding and decoding also called encapsulation and decapsulation.

This ensures the information is not accessible by other parties except the two hosts involved.

Operating Systems Interconnected model (OSI) is used to standardise communication in a computing system.

There are 7 layers used in the OSI model:

1. Session Layer

2. Transport Layer

3. Network Layer

4. Data Link Layer

5. Physical Layer

6. Presentation layer

7. Application layer

The information formats given are matched as

a. Packets - Network layer

b. Segments - Transport layer

c. Bits - Physical layer

d. Frames - Data link layer

Consider an entity set Person, with attributes social security number (ssn), name, nickname, address, and date of birth(dob). Assume that the following business rules hold: (1) no two persons have the same ssn; (2) no two persons have he same combination of name, address and dob. Further, assume that all persons have an ssn, a name and a dob, but that some persons might not have a nickname nor an address.
A) List all candidate keys and all their corresponding superkeys for this relation.
B) Write an appropriate create table statement that defines this entity set.

Answers

Answer:

[tex]\pi[/tex]

Explanation:

Other Questions
Do you like quackity? :))) look at the subject... a scientist recorded the temperature of the first day of spring for 24 hours starting from Midnight their hours the scientist recorded a low of 44f and a high of 67f. What is x in 8x - 5 = -37 Songs you wrote from your head that i can re edit itfrom your own head1st person gets a crownplease help me i don't know what to write a song aboutplease help me or are you a chicken Read this excerpt. Screen time can have positive effects and can be used for learning, but it can also be negative and toxic to teens. At home, teens use screen time to connect with others, watch videos, and play games, but also to engage in social media banter and sharing. At school, students may watch educational videos that connect to a lesson. Either way, teens are getting more screen time than ever before. Both parents and teachers need to set limits. Just because the technology is available does not mean it is always helpful, experts say. Which detail best supports the argument that screen time can be beneficial at school? At home, teens use screen time to connect with others, watch videos, and play games, but also to engage in social media banter and sharing. At school, students may watch educational videos that connect to a lesson. Either way, teens are getting more screen time than ever before. Just because the technology is available does not mean it is always helpful, experts say. Book two roads chapter 27 summary Luisa deposits $44.60 to her bank account on Tuesday morning. on Wednesday, she withdraws $66.30 on Thursday, she wildew $30 Which answer choke represents the balance in her account on Thursday?A $51.70 B $140.90. C $ -22.00. D $-51.70 Raul has 6 shoeboxes on his bookshelf. If he has 9 toy robots in each shoebox, howmany toy robots does Raul have?A. 63B. 54C. 36D. 15< BackClear AnswerNext > Find the area of the shape shown below plz help What does totalitarianism mean Read the following paragraph. How does sentence 3 develop the main idea of the paragraph? (5 points)Gertrude Belle Elion was born on Jan. 23, 1918, in New York City.She graduated from Hunter College in New York City with a degree in biochemistry in 1937.Unable to obtain a graduate research position because she was a woman, she took a series of jobs, including lab assistant, chemistry and physics teacher in New York City high schools, and research chemist.During this time she also took classes at New York University, where she earned a master's degree in 1941.Because she could not devote herself to full-time studies, Elion never received a doctorate. at the cellular level, what caused Sally's cancer If the area of a rectangle is x2 13x + 40, what are the lengths ofthe two sides? Which hypothesis helps to explain why all organisms share the same genetic code? FORUM DESCRIPTIONIs it fair to let financial pressures determine how much we are willing to spend to promote justice and public safety? Do we need to consider other issues to determthe U.S. corrections system is too large? What might some of those reasons be? Are they more important than money? How can a law get passed if the president doesn't want it Set a flat foot on the ground with weight. A. Jump B. Stamp C. Slap D. Flap when you look directly at a camera lens, it may seen like there is only one lens, but entering light actually passes through a series of lenses, or_____, that bend the light and send it on its way to be focused on the film or digital. chipFrameOptics Flash SD cARD which of the following is equivalent to the sum of expressions a to the power of 2-1 and a+1 What are the two solutions of x^2-2x-4=-3x+9