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
dolphi86 [110]
3 years ago
15

Which of the following is true regarding the use of instance variable j in class B1?

Computers and Technology
1 answer:
melisa1 [442]3 years ago
6 0

Answer: A) It is directly accessible only in B1

Explanation: In the given chunk of code, Class B1 is a base class. Class B2 is derived class of class B1. Class B3 is derived class of B2. As you can see class B1 has two members or instance variables i and j. Instance variable cannot be directly accessible by both B2 and B3. If you see this statement of the given code  private int j; the keyword private is used with the variable j. This keyword is called access specifier. Access specifiers specifies how the members of a class can be accessed. These members are attributes and methods of that class. Any member of a class that are declared private cannot be inherited by derived classes of that class.  Additionally these private members cannot be accessed from within any method inside derived class. So j is directly accessible only in B1. You can access a private instance variable from within the same class or can access  it through the methods of class.

You might be interested in
What ip class is this address: 128-191.255.255.255?
defon
Class B would be the correct answer.
4 0
3 years ago
True or false mobile devices need to work within limited screen space
eduard
A phone may have a 4 inch screen and so it cant just extend to 5 inches. So it would he true
3 0
2 years ago
Read 2 more answers
Write code which takes a user input of a String and an integer. The code should print each letter of the String the number of ti
Alexus [3.1K]

import java.util.Scanner;

public class JavaApplication70 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Input a String:");

       String txt = scan.nextLine();

       System.out.println("Input an integer:");

       int num = scan.nextInt();

       String newTxt = "";

       int w = 0;

       for (int i = txt.length()-1; i >= 0; i--){

           char c = txt.charAt(i);

           while (w < num){

               newTxt += c;

               w++;

           }

           w = 0;

       }

       System.out.println(newTxt);

   }

   

}

I hope this helps!

7 0
3 years ago
Read 2 more answers
Which statements are true about a database?
anzhelika [568]

Answer:

you cannot leave a field empty

you can enter data based on the defined data type

6 0
2 years ago
Read 2 more answers
Ethernet ensures that _____ on a shared network never interfere with each other and become unreadable.
Dmitry [639]

Answer:

Signals.

Explanation:

Encryption is a form of cryptography and typically involves the process of converting or encoding informations in plaintext into a code, known as a ciphertext. Once, an information or data has been encrypted it can only be accessed and deciphered by an authorized user.

Some examples of encryption algorithms are 3DES, AES, RC4, RC5, and RSA.

Ethernet ensures that signals on a shared network never interfere with each other and become unreadable through the use of encapsulation and standard encryption protocols.

In Computer Networking, encapsulation can be defined as the process of adding a header to a data unit received by a lower layer protocol from a higher layer protocol during data transmission. This ultimately implies that, the header (segment) of a higher layer protocol such as an application layer, is the data of a lower layer such as a transportation layer in the Transmission Control Protocol and Internet Protocol (TCP/IP).

The TCP/IP model comprises of four (4) layers;

1. Application layer: this is the fourth layer of the TCP/IP model. Here, the data unit is encapsulated into segments and sent to the transport layer.

2. Transport layer (layer 3): it receives the segment and encapsulates it into packets and sends to the internet layer.

3. Internet layer (layer 2): packets are encapsulated into frames.

4. Network layer (layer 1): frames are then converted into bits and sent across the network (LAN).

Hence, the data unit encapsulated inside a packet is known as segment, which is typically referred to as packet segmentation.

Additionally, these data, segments, packets, frames and bits transmitted across various layers are known as protocol data units (PDUs).

8 0
2 years ago
Other questions:
  • You are given n sorted sequences each one containing n keys. You may assume n is a power of two. We want to merge them into one
    15·1 answer
  • Write the steps for displaying multiple subtotal functions in excel.
    10·1 answer
  • What do you click to create a new presentation in Normal view
    14·1 answer
  • Question 11
    11·1 answer
  • What lets you do many things, like write book reports and stories?
    15·1 answer
  • Greg is the network administrator for a large stadium that hosts many events throughout the course of the year. They equip usher
    7·1 answer
  • Let's go! About to hit 40k!!! Glad to help on Brainly®!!!
    11·1 answer
  • Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, s
    11·1 answer
  • Which of the following code is correct? I: print("Programming is fun") print("Python") print("Computer Science") II: print("Prog
    11·1 answer
  • One of your suppliers has recently been in the news. Workers complain of long hours, hot and stuffy workrooms, poor lighting, an
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!