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
Anarel [89]
3 years ago
9

Create a class BankAccount with 2 variables, a int balance, and a string name. Then create an instance of the BankAccount Class,

change its name and balance, and print its name and balance.
Computers and Technology
1 answer:
almond37 [142]3 years ago
6 0

Answer:

Follows are the code to the given question:

class BankAccount //defining a class BankAccount

{

 int balance;//defining integer variable balance  

 String name;//defining String variable name

 BankAccount()//defining default constructor

 {

 }

  BankAccount(int balance, String name)//defining parameterized constructor that accepts two parameters  

  {

     this.balance = balance;//use this to hold parameter value

     this.name = name;//use this to hold parameter value

  }

}

public class Main//defining Main class

{

 public static void main(String[] asr)//main method  

 {

  BankAccount obv = new BankAccount(1969, "Mustang");//creating class object and pass value in parameter

   System.out.println("Your name is: " + obv.name + " and " +"Your balance is: "+ obv.balance);//print value with message

 }

}

Output:

Your name is: Mustang and Your balance is: 1969

Explanation:

In this code a class "BankAccount" is declared, that  defines the two variable "name and balance" as a integer and string, and in the next step a parameterized constructor is declared, that uses this keyword to hold value.

In the main class the main method is declared and inside the method class object is created that accepts parameter value and use the print method to print its value.

You might be interested in
Jim has excellent oral and written communication skills. He enjoys public speaking and wants a job in which he will interact wit
fredd [130]
The best job for Jim would be public relations specialist.
7 0
3 years ago
Read 2 more answers
Jameelah has files all over her computer. Thus, it is often difficult for her to find the files she is looking for.
VLD [36.1K]

Answer:

folders

Explanation:

it is a very good way to keep your desktop organized and keep tidy

3 0
3 years ago
Guys how do i add or insert a diagram for similarities on google docs.
Vikki [24]
Usually I go to the Photos and I find a photo that already had the diagram
7 0
3 years ago
Which is a feature of a correlated subquery? a. The outer subquery executes independent of the inner subquery. b. The outer subq
Mama L [17]

Answer:

b. The outer subquery initiates the process of execution in a subquery.

B is correct.

Explanation:

The important feature of a correlated subquery is: It must be executed repeatedly because it depends on the value from the outer SELECT, and must execute once for every value that the outer SELECT produces.

3 0
3 years ago
Amelie lists her dishwasher for sale on eBay. Ryan, who lives in another city, bids for the best price and uses his credit card
NemiM [27]

Answer:

Yes

Explanation:

e-commerce or electronic commerce is an online platform, where web technologies is used as a medium for business transaction between a buyer and a seller.

The e-commerce platform provides the online marketplace and the electronic payment medium for customers of an e-store to easily acquire the products and services they need.

eBay is an example of an e-commerce website that provides individuals with the medium to sell and buy what they need.

8 0
4 years ago
Other questions:
  • What are the five types of alignment in Word?
    12·2 answers
  • Amazon SWF is restricts you to use a specific programming language when setting up a work flow
    8·1 answer
  • What happens when a flash memory card is installed in a slot and it is recognized by windows?
    6·1 answer
  • Trish has bought a new computer, which she plans to start working on after a week. Since Trish has not used computers in the pas
    12·2 answers
  • Which do switches create?<br> Networks<br> Wireless access points<br> Routes<br> Collision domains
    13·1 answer
  • Complete the sentence.<br> A ___ number is composed of only zeros and ones.
    8·1 answer
  • 33. (03.03 LC)
    9·1 answer
  • GRAND THEFT AUTO 5 LOLLL
    15·2 answers
  • As Jane was setting up her projector, she realized that the images on the screen appeared blurred. How would Jane sort out the i
    6·2 answers
  • A construction-based client would like to develop an application that can analyze an image of machinery and overlay information
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!