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
Explain briefly the use of the computers in the advertising area​
olya-2409 [2.1K]

Answer:

Brainly.con

Explanation:

5 0
2 years ago
Directions: pick the right letter for each number.
Ede4ka [16]

1. Upgrading RAM increases run speed.

2. Upgrading Hard Drive increases memory.

3. Adding more ROM to it..?

8 0
3 years ago
Read 2 more answers
Sam wants to move across the text and his documents to add data at predefined stops. Which key will Hughes to navigate through t
Setler [38]

Answer:

The TAB key

Explanation:

Sam would use the TAB key, located on the left side of the keyboard, to move around his document to add stops and format its information properly.

Pressing the TAB key will introduce a tab code in his document, which is like moving ahead by a certain number of spaces (5,6, 10 spaces for example, depending on the configuration of the document), but without using spaces, using a tab which is a much better option to position, align things up.

5 0
3 years ago
How is geeking out related to the concept of social capital?
vodka [1.7K]

Answer:

It relates to social relationships and social structures. It involves people knowing each other and having positive relationships based on trust, respect, kindness, ect.

Explanation:

3 0
2 years ago
Which format must a document be saved in to share it between two different word processors?. Select one of the options below as
slava [35]
When two different word processors are used to share a document, the word document must be saved in the compatibility format where some of the aspects of one version is retained and reflected in the other version while others cannot be retrieved due to the alteration or absence of a component. 

6 0
2 years ago
Other questions:
  • 20. Which of the following describes an acceptable print resolution?
    10·2 answers
  • How to go to a website with an ip address?
    15·1 answer
  • PLEASE HELP<br><br><br> i’m doing a internet safety brochure. what is a good hook ?!
    14·1 answer
  • Terms that represents the achual speed used by device to transfer data​
    14·1 answer
  • Which of these is NOT a desktop computer operating system?
    8·2 answers
  • me pueden ayudar con mi trabajo sii porfss si me dan la respuesta correcta y les doy la mejor coronita si​
    12·1 answer
  • Select three physical forms of storage. USB drive Primary cache Magnetic storage Secondary cache Dynamic RAM Optical drive
    7·2 answers
  • What method of thermal energy is at work when heat lamps are used to warm up baby chickens?
    11·2 answers
  • A program with a graphical user inter-face for displaying HTML files, used to navigate the World Wide Web.
    8·1 answer
  • What is an advantage of using a fully integrated cloud based data analytics platform
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!