menu
Qamnty
Login
Register
My account
Edit my Profile
Private messages
My favorites
Which is the instance variable in the given code? public class Person{ public intpid; private double salary; public Person (intpersonID){ pid = personID; } public void setSalary…
Ask a Question
Questions
Unanswered
Tags
Ask a Question
Which is the instance variable in the given code? public class Person{ public intpid; private double salary; public Person (intpersonID){ pid = personID; } public void setSalary…
asked
May 7, 2021
209k
views
2
votes
Which is the instance variable in the given code?
public class Person{
public intpid;
private double salary;
public Person (intpersonID){
pid = personID;
}
public void setSalary(double empSal){
salary = empSal;
}
public void printDetails(){
System.out.println("id : " + pid );
System.out.println("salary :" + salary);
}
public static void main(String args[]){
Person P = new Person("P1");
P.setSalary(100);
P.printDetails();
}
}
A. public intpid;
B. private double salary;
C. intpersonID
D. double empSal
E. Person P = new Person("P1");
Computers & Tech
college
M G
asked
by
M G
7.7k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
3
votes
Answer:
Person P is a new instance of Persons class
-- located in the main class
Ragnar Kruse
answered
May 11, 2021
by
Ragnar Kruse
9.0k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Jan 25, 2021
181k
views
Assume the following two classes as Person and Working: class Person { int personID, age; String fName, middleName, lastName; ... // the code here is irrelevant to the question } // end of Person class
Alan Turing
asked
Jan 25, 2021
by
Alan Turing
8.0k
points
Computers & Tech
college
1
answer
0
votes
181k
views
Ask a Question
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.
Categories
All categories
Mathematics
(3.7m)
History
(955k)
English
(903k)
Biology
(716k)
Chemistry
(440k)
Physics
(405k)
Social Studies
(564k)
Advanced Placement
(27.5k)
SAT
(19.1k)
Geography
(146k)
Health
(283k)
Arts
(107k)
Business
(468k)
Computers & Tech
(195k)
French
(33.9k)
German
(4.9k)
Spanish
(174k)
Medicine
(125k)
Law
(53.4k)
Engineering
(74.2k)
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qamnty