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
NikAS [45]
3 years ago
7

g If a class named Student has a data member named gpa , and one of its member functions has a parameter also named gpa , how ca

n you refer to the data member inside that member function
Computers and Technology
1 answer:
victus00 [196]3 years ago
5 0

Answer:

By using the this keyword

Explanation:

The this keyword in java is used for pointing the current object or current variable .The this keyword is removing the ambiguity among the characteristics of the class as well as the variables with the similar name.

In the given question if the class student has member variable gpa also we have a method having the argument gpa with the help of this keyword we can refer the gpa variable inside the method .

Following are the implementation of the given question

public class Main // main class

{

 int gpa; // variable declaration

 public Main(int gpa) // constructor

 {

   this.gpa = gpa; // this keyword

 }

 public static void main(String[] args) // Main method

 {

   Main m= new Main(55); // creating object of class

   System.out.println("The Value of gpa is : " + m.gpa); // display value

 }

}

Output:

The Value of gpa is :55

You might be interested in
Sarah is creating and formatting a newsletter for her school. Which page layout rules should she consider when doing this?
lorasvet [3.4K]
Hey!

I believe the answer to 1. Should be A. Rule of Thirds.
6 0
3 years ago
Read 2 more answers
True or false there is no relationship between the purpose of the page and the page quality
erastovalidia [21]

True, this is correct. There is no relation between page purpose and page quality, because the way they rate the quality of the page depends on the appearance and content of the page.

8 0
3 years ago
PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
AveGali [126]

Answer:

I think it the answer will be 0,1,2,3,4

Explanation:

7 0
2 years ago
Read 2 more answers
What does hdtv stand for
Gnesinka [82]
High Definition Television
8 0
3 years ago
Read 2 more answers
A researcher develops a new instrument to measure coping skills and conducts a pilot study to compare the new tool with an exist
alexira [117]

Answer:b)convergence.

Explanation: Convergence has the basic meaning as when two or more unit of anything meet to converge or join. In the research , the different types of the tools are brought togather and skills and compare them.The measurement is done through the tools which has the already defined parameters.

Thus this concept is the example of the convergence because the tools are being converged and compared.so, the correct answer is option (B) and other option are incorrect because they have the technique of the contrasting and separation and reading respectively.

3 0
3 years ago
Other questions:
  • ________ is used to store programs and instructions that are automatically loaded when the computer is turned on.
    14·1 answer
  • In the game of economics, which player has the role of providing goods and services
    10·1 answer
  • Fill in the blank
    11·1 answer
  • Rate is how fast a screen updates the information being displayed.
    6·2 answers
  • PLEASE HELP ASAP
    10·2 answers
  • An element in an array is 4 bytes long and there are 10 elements in the array. How big is the array?
    6·2 answers
  • Write an expression to compute the quartic root of x. the quartic root of a number is the square root of its square root. exampl
    11·1 answer
  • How can you say that a painting is real? ​
    7·2 answers
  • What is the two’s compliment of -95,-122,-111,-57
    9·1 answer
  • A ____ is someone who develops programs and apps or writes the instructions that direct the computer or mobile device to process
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!