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]
2 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]2 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
The scientific process is most similar to what
Papessa [141]

Answer:

A dyagram

Explanation:

Have a nice day.

-London

8 0
2 years ago
99 points!!! What would happen to the document if the change “A” is pointing to was accepted? a. There would be no changes. b. “
Sophie [7]
Probably, terrific would be inserted
3 0
3 years ago
Read 2 more answers
4. The Internet may best be compared to a/an A. series of colored lights. B. loud truck motor. C. enormous skyscraper. D. large
Triss [41]
D. Large network of roads.

A resembles a modem/router and C a webserver.
6 0
3 years ago
The ________ is responsible for the Internet's domain name system and the allocation of IP addresses.
Agata [3.3K]

Answer:

The answer is "ICANN"

Explanation:

In the given question some information is missing, that is option, which can be described as follows:

A) IAB

B) ICANN

C) W3C

D) ISOC

It manages the installation and processes of multiple databases concerning the Network domain and  provides a stable and safe networking service, and wrong choices were explained as follows:

  • IAB, It provides a protocol to manage IETF, that's why it is wrong.
  • W3C is used in web development.
  • ISOC is used to provide internet accessibility.
6 0
3 years ago
Select the correct answer.
S_A_V [24]
I think the answer is b
5 0
3 years ago
Other questions:
  • What component on a smartphone requires pairing with another device?
    8·1 answer
  • A(n) __________ employs a method called "tunneling" in which each packet from the sending computer is encapsulated within anothe
    8·1 answer
  • The ____ button resets slide placeholders to their default position, size, and text formatting.
    11·1 answer
  • Which principle of animation deals with imparting a unique identity to the animated character?
    5·1 answer
  • Kyle asked his supervisor which type of computing model was used when the enterprise first started. She explained that the organ
    14·1 answer
  • You can use this type of program to create a new raster image
    9·1 answer
  • Dimensional arrays can be created using loops. 2 dimensional arrays can be created using:
    10·1 answer
  • the ghost adventures team uses a variety of tools and technology in investigations. which one is described as an adjustable freq
    9·1 answer
  • Which of the following describe the characteristics of a good logo? Choose all that apply. It is a complex design It is memorabl
    12·1 answer
  • Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know th
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!