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
An installation is:<br> please help asap
pogonyaev

Answer:  an installation is the act of putting something in, a device that stays in one place, a military base, or an art piece that often involves building and different types of materials.

Explanation:

Getting your new air conditioner put in is an example of an installation.

4 0
3 years ago
Write a statement to create a Google Guava Multimap instance which contains student ids as keys and the associated values are st
Sergeu [11.5K]

Answer: provided in the explanation section

Explanation:

Note: take note for indentation so as to prevent error.

So we import com.google.common.collect.Multimap;

import java.util.Collection;

import java.util.Map;

class Main {

   public static void main(String[] args) {

       // key as studentId and List of Profile as value.

       Multimap<String,Profile> multimap = ArrayListMultimap.create();

       multimap.put("id1", new ExamProfile("examStudentId1"));

       multimap.put("id1", new ELearningProfile("userId1"));

       multimap.put("id2", new ExamProfile("examStudentId2"));

       multimap.put("id2", new ELearningProfile("userId2"));

       // print the data now.

       for (Map.Entry<String, Collection<Profile>> entry : multimap.entrySet()) {

           String key = entry.getKey();

           Collection<String> value =  multimap.get(key);

           System.out.println(key + ":" + value);

       }

   }

}

// assuming String as the studentId.

// assuming Profile as the interface. And Profile can multiple implementations that would be

// specific to student.

interface Profile {

}

class ExamProfile implements Profile {

   private String examStudentId;

   public ExamProfile(String examStudentId) {

       this.examStudentId = examStudentId;

   }

}

class ELearningProfile implements Profile {

   private String userId;

   public ELearningProfile(String userId) {

       this.userId = userId;

   }

}

This code is able to iterate through all entries in the Google Guava multimap and display all the students name in the associated students profile.

8 0
3 years ago
It's possible to __________ out of a loop if the user has entered an incorrect value that would cause an error or a problem with
Stella [2.4K]

Answer:

The answer is Break

<u>Explanation:</u>

When break statement is occurred then, it immediately exits from the loop and executed the statement after the loop without raising any kind of error.

<u>The situation after entering of a value by a user </u>

  • If the user entered incorrect value then it will exit from the loop.
  • If the user entered correct input value, then it will run the loop for the further values.

4 0
2 years ago
Write a python program to calculate the length of any string recursively​
Solnce55 [7]

Answer:

b

Explanation:

6 0
2 years ago
A person who breaks into a computer, network, or online site is called
dybincka [34]

Answer:

B: Hacker

Explanation:

literally anything else aren't even real things besides hacker.

5 0
2 years ago
Read 2 more answers
Other questions:
  • Spreadshet formula to add totals​
    12·1 answer
  • "what should you do if the system continually reboots and you can't read the error message produced on a blue screen
    11·2 answers
  • Which best describes the benefits of renting a home?
    10·2 answers
  • What tool can help discover and report computer errors and conflicts that occur when you first turn on a computer and before the
    15·1 answer
  • Write a program with a method computeCommission which takes a double that is the salesAmount and returns the commissions for sal
    9·1 answer
  • What is internet?<br>what is online?​
    5·1 answer
  • Most significant effect the rotary press had on printing
    9·1 answer
  • 2. Which pattern microphone should Jennifer take to the press conference? Jennifer is a journalist with one of the leading newsp
    14·1 answer
  • If 209g of ethanol are used up in a combustion process, calculator the volume of oxygen used for the combustion at stp​
    5·1 answer
  • What is a best practice when approaching an automation effort?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!