1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
deff fn [24]
3 years ago
15

Name the different types of constructors that a designer can provide in a class. Provide an example with a class showing many co

nstructors.
Computers and Technology
1 answer:
Marrrta [24]3 years ago
8 0
By default, if you do not implement a constructor, the compiler will use an empty constructor (no parameters and no code). The following code will create an instance of the MyObject class using the default constructor. The object will have the default vauesfor all the attributes since no parameters were given.

MyObject obj = new MyObject();

Another type of constructor is one with no parameters (no-arg constructor). It is similar to the default, except you actually create this constructor. The contents of the the constructor may include anything. To call a no-arg constructor, use the same line of code as above. The constructor can look like the one below:

public MyObject() {
System.out.println("This is a no-arg constructor");
}

Lastly there is the parameterized constructor. This type of constructor takes in parameters as inputs to assign to values in the newly created object. You call a parameterized constructor as follows:

MyObject obj = new MyObject("Bob", 20);

The constructor will look like this:

public MyObject(String name, int age) {
this.name = name;
this.age = age;
}

In the constructor, the keyword "this" refers to the object, so this.name is a private global variable that is being set equal to the inputted value for name, in this case "Bob".

Hope this helps!
You might be interested in
Do you agree to the song that ''magtanim ay di biro?'' why?
iren [92.7K]

Answer:

I agree in this song because being a farmer is not easy you need to be hardwork

5 0
2 years ago
What changes should be made in OSI model(Open System Interconnection).
saveliy_v [14]

Answer:

Explanation:

When most non-technical people hear the term “seven layers”, they either think of the popular Super Bowl bean dip or they mistakenly think about the seven layers of Hell, courtesy of Dante’s Inferno (there are nine). For IT professionals, the seven layers refer to the Open Systems Interconnection (OSI) model, a conceptual framework that describes the functions of a networking or telecommunication system.

The model uses layers to help give a visual description of what is going on with a particular networking system. This can help network managers narrow down problems (Is it a physical issue or something with the application?), as well as computer programmers (when developing an application, which other layers does it need to work with?). Tech vendors selling new products will often refer to the OSI model to help customers understand which layer their products work with or whether it works “across the stack”.

Layer 7 - Application

To further our bean dip analogy, the Application Layer is the one at the top--it’s what most users see. In the OSI model, this is the layer that is the “closest to the end user”. It receives information directly from users and displays incoming data it to the user. Oddly enough, applications themselves do not reside at the application layer. Instead the layer facilitates communication through lower layers in order to establish connections with applications at the other end. Web browsers (Google Chrome, Firefox, Safari, etc.) TelNet, and FTP, are examples of communications  that rely  on Layer 7.

Layer 6 - Presentation

The Presentation Layer represents the area that is independent of data representation at the application layer. In general, it represents the preparation or translation of application format to network format, or from network formatting to application format. In other words, the layer “presents” data for the application or the network. A good example of this is encryption and decryption of data for secure transmission - this happens at Layer 6.

4 0
2 years ago
Read 2 more answers
The National Vulnerability Database (NVD) is responsible for actively performing vulnerability testing for every company's softw
V125BC [204]

Answer:

False

Explanation:

The answer to this question is false. This is because the NVD doesn't perform such tests on their own. Instead they they rely on third-party vendors, software researchers, etc to get such reports and do the assignment of CVSS scores for softwares

The National Vulnerability Database (NVD) is the United State governments leading resource for software vulnerability

8 0
2 years ago
L a s t. i achieve 15 of 15 question on brainly.
Veseljchak [2.6K]
The Control key on a computer keyboard is a key that is used by pressing it in combination with other keys, enabling other keys on the keyboard to perform secondary functions. It is generally labeled as Ctrl.
4 0
2 years ago
The rules that govern the correct order and usage of the elements of a language are called the of the language:.
Strike441 [17]

The syntax of a language are the rules that govern the correct order and usage of the elements of a language.

<h3>What is a programming language?</h3>

This is a set of rules that are used to send commands to a computer system as a prompt to have it perform certain tasks.

The syntax of a language are the rules that are used in that particular programming language.

Read more on syntax here: brainly.com/question/21926388

7 0
1 year ago
Other questions:
  • A(n) _______ created in Microsoft Word or another word-processing program works well as a shell for a PowerPoint presentation.a.
    9·1 answer
  • In Microsoft Word you can access the _______ command from the "Mini toolbar
    11·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • 1. Which of the following should NOT be in a tagline?
    12·1 answer
  • Write a function that, given an array A of N integers, of which represents loads caused by successive processes, the function sh
    15·1 answer
  • Why do TV shows/Movies from the 90's and early 2000s look so much different compared to today?
    7·1 answer
  • What is something that can be done to help stop teen teen crashes
    8·1 answer
  • Audiovisual means that a presentation combines film and photos.<br> true or false?
    6·2 answers
  • An open intersection is one that
    9·2 answers
  • Please help me willgive u brainliest​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!