What is an instance variable and how do you declare one?
-
I need to create the private instance variable savingsBalance, which includes the amount the saver has on deposit, and the saver's first and last name.
-
I need to create the private instance variable savingsBalance, which includes the amount the saver has on deposit, and the saver's first and last name.
You can use a class, struct or 3 variables/properties declared
private
.private class SavingsBalance()
{
public string FirstName {get; set;}
}Never underestimate the power of human stupidity RAH
-
You can use a class, struct or 3 variables/properties declared
private
.private class SavingsBalance()
{
public string FirstName {get; set;}
}Never underestimate the power of human stupidity RAH
Wait a minute, aren't you creating a class and not a variable?
-
Wait a minute, aren't you creating a class and not a variable?
Sure, that example - you can create a private class inside another class. Or use 3 private variables or use a struct.
Never underestimate the power of human stupidity RAH
-
I need to create the private instance variable savingsBalance, which includes the amount the saver has on deposit, and the saver's first and last name.
I think you need to talk to your teacher. It sounds like you're struggling with some real basics.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
You can use a class, struct or 3 variables/properties declared
private
.private class SavingsBalance()
{
public string FirstName {get; set;}
}Never underestimate the power of human stupidity RAH
He seems below to be saying he wants to store a string that contains the name and the balance. He actually had the code to do that posted.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.