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
KatRina [158]
3 years ago
12

Which class members should be declared as public?

Computers and Technology
1 answer:
yawa3891 [41]3 years ago
6 0

Answer:

B. Methods and occasionally final attributes

Explanation:

In Computer programming, class members can be defined as the members of a class that typically represents or indicates the behavior and data contained in a class.

Basically, the members of a class are declared in a class, as well as all classes in its inheritance hierarchy except for destructors and constructors.

In a class, member variables are mainly known as its attributes while its member function are seldomly referred to as its methods or behaviors.

One of the main benefits and importance of using classes is that classes helps to protect and safely guard their member variables and methods by controlling access from other objects.

Therefore, the class members which should be declared as public are methods and occasionally final attributes because a public access modifier can be accessed from anywhere such as within the current or external assembly, as there are no restrictions on its access.

You might be interested in
Write a method that takes two arguments: two integers. The integers are then squared, added and the result printed on the screen
diamong [38]

Answer:

import java.util.Scanner;

class Main

{

   

     public static void main(String[] args)  

     {

     System.out.println(" Enter the the two numbers:");

     Scanner input = new Scanner(System.in);

     int a = input.nextInt();

     int b = input.nextInt();

     int c = sumsquareFunction(a, b);

     System.out.println("Sum of Square of two numbers are:" + c);

     }

public static int sumsquareFunction(int n1, int n2) {

     int c= n1*n1 + n2*n2;

     return c;  

  }

}

Explanation:

Please check the answer.

6 0
4 years ago
A small program that sends itself to other computers, rather than relying on user actions, is a
PSYCHO15rus [73]

Virus.

A virus is a malicious program or script that Spreads. 

Malware, however, will not spread. 

Viruses can spread without a victim's permission because it is automated to do so. 

For example, the Melissa virus would look like a file attachment that used reverse psychology to make you open it. From there, it goes through the first 50 email contacts stored on your computer and sends the virus to them from your computer. 
8 0
3 years ago
(Game Design) Creating and manipulating data structures is one of the primary functions of a development environment.
Galina-37 [17]

true i believe im not for sure

7 0
3 years ago
Read 2 more answers
Which type of storage disk and disk drive can you use in the given situation?
Margarita [4]

Answer:

The answer to this question is DVD and DVD-RW

Explanation:

6 0
3 years ago
A(n) ___ converts between digital data the computer understands and analog signals that are transmitted over telephone or cable
zhannawk [14.2K]
A modem is probably what you are looking for.
3 0
3 years ago
Other questions:
  • To copy noncontiguous slides, open Slide Sorter view, click the first slide thumbnail, press and hold ____, click each additiona
    15·1 answer
  • Atieno is a musician who records music on her computer. Which devices do you think she would need the most?
    12·1 answer
  • Novice drivers lack the experience necessary to reliably categorize and appropriately respond to ___________ hazards.
    11·1 answer
  • You are running out of storage space on one of your servers. you need to purchase an external hard drive, as there are no drive
    8·2 answers
  • You have stumbled on an unknown civilization while sailing around the world. The people, who call themselves Zebronians, do math
    11·1 answer
  • EX 3.8 Write code to declare and instantiate an object of the Random class (call the object reference variable rand). Then write
    6·1 answer
  • How many fixes are available for Adobe Photoshop CS4 (64 Bit)?
    9·1 answer
  • Four major parts of the keyboard
    12·2 answers
  • Bob has started a company and registered its name with the government as a private corporation. He tries to create a domain name
    12·1 answer
  • What are Operating Systems?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!