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
Suppose there is exactly one packet switch between a sending user and a receiving user. The transmission rates between the sendi
Paha777 [63]

Answer:

L(\frac{1}{R_1}+\frac{1}{R_2}  )

Explanation:

R_1 is the transmission rates between the sending user and the switch while R_2 is the transmission rates between the switch and the receiving user and the length of the packet is L

Considering no propagation delay the time taken to transmit the packet from the sending user to the switch is given as:

t_1=\frac{L}{R_1}

the time taken to transmit the packet from the switch to the receiving user is given as:

t_2=\frac{L}{R_2}

therefore the total end-to-end delay to send a packet is:

t=t_1+t_2=\frac{L}{R_1}+\frac{L}{R_2} =L(\frac{1}{R_1}+\frac{1}{R_2}  )

6 0
3 years ago
What is internet? short ans​
Cerrena [4.2K]

Answer:

The Internet is a big network that connects computers all over the world.

3 0
3 years ago
Which is an example of oversharing using GPS?
sergij07 [2.7K]
I believe it is D


Social media networks make it easy to help share what’s going on in your life. The problem is when the wrong people get hold of that information. Criminals are smart. They’re connected, and they know how to use the Internet to their advantage. Stalking a victim, getting to know their routines and the times they’re home (and when they’re not) is as easy as opening a web browser and checking an open account. This excellent infographic from Credit Sesame helps illustrate exactly how your social media info can be misused. Last week, Cult of Mac ran a story that went viral about an app called Girls Around Me which aggregated public profiles of women in an area. Everything from check-ins, status updates, profiles and photo albums were aggregated for app users to see. As a result of the article, Foursquare has since revoked the app’s API access, disabling many of the app’s features. Scary stuff. While the app is hopefully mothballed, it highlighted a lot of security risks that are associated with being on social media. The safest option is to simply not use social media. But I’ll be honest: I can’t imagine deleting my social profile. Luckily, you don’t have to. Being vigilant about safeguarding your profile – and being selective about what you share and who you share it with – can help reduce the risk of using social media.


If you need more info LMK. If this is incorrect please comment that it is, along with the correct answer so I can figure out my error, have a great day TPWK
7 0
3 years ago
Read 2 more answers
The executive ________ is the person ultimately responsible to their company for the project's success.
sladkih [1.3K]

Answer:

Manager.

Explanation:

Just thank me later and make sure to click the crown at the top of this answer ;)

3 0
3 years ago
Determining the context of a text or media piece helps ypu:
goldenfox [79]
Also but if always two point eight eighty
5 0
3 years ago
Other questions:
  • Angela wrote some lines of code that she wants to test. She will need to use __________. IDLE open source a prompt a file path
    15·2 answers
  • Assume that an array of integers named a that contains exactly five elements has been declared and initialized. Write a single s
    8·1 answer
  • What is the subjects under artificial intelligence ?​
    15·1 answer
  • In the lecture, we saw that TCP waits until it has received three duplicate ACKs before performing a fast retransmit. Why do you
    10·1 answer
  • 1. INTRODUCTION In this project, you will gain experience with many of the Python elements you’ve learned so far, including func
    6·1 answer
  • Ba esti prost?<br> Ba esti nebun?<br> Ce ai?
    5·2 answers
  • After reviewing device security you learn that a malicious user in an airport
    14·1 answer
  • The recipient list cannot be edited.<br> Group of answer choices<br><br> True<br><br> False
    5·1 answer
  • Why might a programmer want to define his or her own functions? What are some potential disadvantages? How might new functions m
    10·1 answer
  • Web résumés allow you to include extra graphics and images that you would not include in a traditional résumé. Please select the
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!