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
There are 4 classrooms for fifth grade and 4 classrooms for sixth grade at a school. Each classroom has 20 students. A teacher i
olga_2 [115]

Answer:

what do you want

Explanation:

there are 160 people in all if thatś what you want

5 0
2 years ago
Read 2 more answers
3<br> Select the correct answer.<br> What is the output of the following HTML code?<br>Please
maw [93]

Answer: or element_id Specifies the relationship between the result of the calculation, and the elements used in the calculation

form form_id Specifies which form the output element belongs to

name name Specifies a name for the output element

Explanation:

7 0
3 years ago
Read 2 more answers
Consider a relation BOOKS that holds information about the inventory of books (used or new) in a bookstore with attributes (titl
Yuri [45]

Answer:

See explaination

Explanation:

Somehing is considered functional dependent (FD) if a relationship between two attributes, typically between the PK and other non-key attributes within a table. For any relation R, attribute Y is functionally dependent on attribute X (usually the PK), if for every valid instance of X, that value of X uniquely determines the value of Y.

Please kindly check attachment for the other details.

5 0
3 years ago
Who is the owner of apple company??​
krek1111 [17]

Answer:

Steve Jobs, in full Steven Paul Jobs, is the owner of apple company

Explanation:

hope it helps

good day

thank u ✌️

7 0
3 years ago
Read 2 more answers
What is the process of ensuring that corporate security policies are carried out<br> consistently?
tester [92]
Policy or security and only conscious
3 0
2 years ago
Other questions:
  • When it comes to saving money, what is a good rule of thumb?
    5·2 answers
  • Using information from the lesson, explain how new technologies change your experience as a consumer.
    5·2 answers
  • Help!!!! ASAP TIMED TEST 50 points!!!!
    7·1 answer
  • I don't understand how to write code for this in Java using nested for loops only. The official question is: write a program tha
    8·1 answer
  • Without entering into the internet cloud or intranet cloud, how many icons in the topology represent endpoint devices (only one
    6·1 answer
  • Does Buzz or APEX shows all your due assignments on the left of the main home screen?
    11·1 answer
  • Difference between academic library and school Library
    5·1 answer
  • What is responsible for recording an image of an object with camera <br> Pls I neeed it right know
    8·1 answer
  • Mattias's friend asked him to critique his presentation about gorillas. Mattias noticed that there weren't any images of gorilla
    6·1 answer
  • Heuristics are not always completely accurate.<br><br><br> Correct or wrong?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!