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
artcher [175]
3 years ago
10

Which of the following class definitions is correct in Java?(i)public class Student{private String name;private double gpa;priva

te int id;public void Student(){name = "";gpa = 0;id = 0;}public void Student(String s, double g, int i){set(s, g, i);}public void set(String s, double g, int i){name = s;gpa = g;id = i;}public void print(){System.out.println(name + " " + id + " " + gpa);}}(ii)public class Student{private String name;private double gpa;private int id;public Student(){name = "";gpa = 0;id = 0;}public Student(String s, double g, int i){set(s, g, i);}public void set(String s, double g, int i){name = s;gpa = g;id = i;}public void print(){System.out.println(name + " " + id + " " + gpa);}}1. Both (i) and (ii)2. None of these3. Only (ii)4. Only (i)
Computers and Technology
1 answer:
Soloha48 [4]3 years ago
4 0

Answer:

The answer is "Option 3".

Explanation:

In the given question the code (ii) is correct because in the class definition class "Student" defines a constructor that does not use any return type. and code (i) class definition the class "Student" defines a constructor that uses return type void which is not allowed in the constructor. and other options are not correct that can be described as follows:

  • In option 1, only code (ii) is correct.
  • In option 2, code (ii) is correct that's why it is not correct.
  • In option 4, it is not correct, because it uses void return type.

You might be interested in
The _____ describes how data actually moves from an application on one computer to an application on another networked computer.
zheka24 [161]

The <u>OSI model</u> describes how data actually moves from an application on one computer to an application on another networked computer.

<h3>What is the OSI model?</h3>

OSI model is an acronym for open systems interconnection and it comprises seven (7) main layers, which typically starts from the hardware layers (layers in hardware systems) to the software layers (layers in software systems)

<h3>The layers of the OSI model.</h3>

Basically, there are seven (7) layers in the open systems interconnection (OSI) model and these include the following in sequential order;

  • Physical Layer
  • Data link Layer
  • Network Layer
  • Transport Layer
  • Session Layer
  • Presentation Layer
  • Application Layer

In this context, we can infer and logically deduce that the <u>OSI model</u> is typically used to describe and illustrate how data moves from a software application on one computer to a software application located on another networked computer.

Read more on OSI model here: brainly.com/question/26177113

#SPJ1

5 0
2 years ago
What are the 3 rules of music<br><br> ps: there is no music subject so i had to put something else
Kitty [74]

Answer:

Rules that apply to all situations and accasions in the music room

Explanation:

I hope this helps

7 0
3 years ago
Read 2 more answers
Positive use of the technology before the pandemic.
Nana76 [90]

Answer:

Positive use of the technology before the pandemic. Is to talk to relatives who live far away. Find a Cool Recipe and to be nice online.

Explanation:

4 0
3 years ago
Which logic gate produces an output of 1 only if both it’s inputs are 0?
riadik2000 [5.3K]

Answer:

B, the NOR gate

Explanation:

The truth table of a NOR gate is below.

5 0
3 years ago
Type the correct answer in the box. Spell all words correctly. What type of network is the Internet? The Internet is an example
denis23 [38]

Answer:

The answer is WAN (Wide Area Network).

Explanation:

  • The Internet is an example of WAN. It stands for wide area network. It is an information network that commonly links to computers that cover a broad specific area. In a WAN, two towns, states, or countries are linked.  
  • The main purpose of using WAN includes a wide range, offers unified information, get upgraded files and software, several email sharing applications, etc.
6 0
3 years ago
Other questions:
  • Days of the week are represented as three-letter strings ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"). Write a javaScript f
    14·1 answer
  • O novo funcionário da equipe de desenvolvimento de sistemas está aprendendo os termos mais utilizados no dia a dia da empresa. A
    7·1 answer
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • Is spread spectrum transmission done for security reasons in commercial WLANs?
    13·1 answer
  • Dust buildup inside a desktop PC case can be managed effectively by ____.
    7·2 answers
  • Technologies have advanced to allow computer chips to be placed in almost anything and to be connected to a network almost anywh
    8·1 answer
  • Write a C++ program that computes an approximation of pi (the mathematical constant used in many trigonometric and calculus appl
    15·1 answer
  • Help with this please anyone
    15·2 answers
  • g Write a function named vowels that has one parameter and will return two values. Here is how the function works: Use a while l
    9·1 answer
  • Which is the correct notation to specify the following inheritance?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!