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
Gelneren [198K]
2 years ago
12

Which XXX declares a student's name. public class Student { XXX private double myGPA; private int myID; public int getID() { ret

urn myID; } } Group of answer choices String myName; public String myName; private myName; private String myName;
Computers and Technology
1 answer:
maw [93]2 years ago
4 0
<h2>Question:</h2>

<em>Which XXX declares a student's name. </em>

public class Student {

   XXX

   private double myGPA;  

   private int myID;

   public int getID() {

        return myID;

   }

}

<em>Group of answer choices </em>

a. String myName;

b. public String myName;

c. private myName;

d. private String myName;

<h2>Answer:</h2>

private String myName;

<h2>Explanation:</h2>

To declare a student's name, the following should be noted.

i. The name of the student is of type <em>String</em>

ii. Since all of the instance variables (myGPA and myID) have a <em>private</em> access modifier, then myName (which is the variable name used to declare the student's name) should be no exception. In other words, the student's name should also have a <em>private</em> access.

Therefore, XXX which declares a student's name should be written as

<em>private String myName;</em>

<em></em>

Option (a) would have been a correct option if it had the <em>private</em> keyword

Option (b) is not the correct option because it has a <em>public</em> access rather than a <em>private</em> access.

Option (c) is not a valid syntax since, although it has a <em>private</em> access, the data type of the variable <em>myName</em> is not specified.

Option (d) is the correct option.

You might be interested in
What makes an active heat sink different from a passive heat sink?
zimovet [89]
An active heat sync will keep a computer cool and basically cool the CPU and processors. A passive heat sink will only cool the CPU and whatever else it needs to cool when the CPU actually NEEDS to be cooled. I am not sure if this is all correct but I know about basic heat syncs and from my understanding this is right.
8 0
3 years ago
Give brainliest if you tell me the can tell me the most random thing
Scorpion4ik [409]

Mood

Explanation:

Because it gets changed by the time you are happy or sad. Same that while you are reading if you like your. mood gets good but if you dont find this ans satisfied your mood gets changed.

3 0
3 years ago
Is October tornado season?
Reptile [31]
No October is not tornado season
5 0
3 years ago
Read 2 more answers
How can you refer to additional information while giving a presentation?
dimulka [17.4K]
The most common way I've seen is to have a slide where you have the additional information. It can be phone numbers, email address, websites, books, anything you want to refer to.
People tend to photograph these slides so make sure the information is error free and that you add you own marketing info to the slide as well.

5 0
2 years ago
What is the domain and path in this URL? www.example.com/homepage.html​
Alex17521 [72]

Answer:

the domain is example.com. the path is /homepage

Explanation:

4 0
2 years ago
Other questions:
  • Information technology is the study of managing, processing, and retrieving information.
    5·1 answer
  • An attribute whose value uniquely identifies an object is called a(n) _______.​
    15·1 answer
  • You want to discard your old computer and want to securely erase the data from your hard drive. What can you use to do this and
    6·1 answer
  • What are some of the advantages of using the F measure (weighted harmonic mean) over using the Precision &amp; Recall when evalu
    15·1 answer
  • Is a psychrometer more likely used at a beach or a desert in California
    12·1 answer
  • Use the ________ property in the html link tag to to associate a web page with a style sheet for printing.
    5·1 answer
  • ______ is a customer-facing CRM application.<br><br> FAQ<br><br> Search<br><br> SFA<br><br> E-mail
    6·1 answer
  • PLEASE HELP!! WILL MARK BRAINLIEST!!
    9·1 answer
  • Consider the following instructions for a game element: Move Forward If not at end, move forward Else stop This is an example of
    10·1 answer
  • Assignment 10 - 1/0 Streams and Files Create a C++ a program that will compute the average word length (average number of charac
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!