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
just olya [345]
3 years ago
12

Write a statement to create a Google Guava Multimap instance which contains student ids as keys and the associated values are st

udent profiles.
Computers and Technology
1 answer:
Sergeu [11.5K]3 years ago
8 0

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.

You might be interested in
which two statements about incoming and outgoing interfaces in firewall policies are true? (choose two.)
Ratling [72]

The statements that are true regarding incoming and outgoing interfaces in firewall policies are:

  • A zone can be chosen as the outgoing interface.
  • -Multiple interfaces can be selected as incoming and outgoing interfaces.

<h3>What is a firewall?</h3>

A firewall is a network security device used in computing that monitors and regulates incoming and outgoing network traffic in accordance with pre-established security rules. Typically, a firewall creates a wall between a trustworthy network and an unreliable network, like the Internet.

A firewall aids in defending your network from intruders. A firewall protects your network by operating as a continuous filter that constantly scans incoming data and blocks anything that appears to be suspicious.

Therefore, the statements that are true regarding incoming and outgoing interfaces in firewall policies are:

A zone can be chosen as the outgoing interface.

-Multiple interfaces can be selected as incoming and outgoing interfaces.

Learn more about firewall on:

brainly.com/question/13693641

#SPJ1

Which statements are true regarding incoming and outgoing interfaces in firewall policies? (Choose two.)

Select one or more:

-An incoming interface is mandatory in a firewall policy, but an outgoing interface is optional.

-A zone can be chosen as the outgoing interface.

-Only the any interface can be chosen as an incoming interface.

-Multiple interfaces can be selected as incoming and outgoing interfaces.

4 0
2 years ago
True or false a mirrorless camera has a pentaprism
inessss [21]

Answer:

No the pentaprism or pentamirror are both optical viewfinder viewing systems and are not part of the mirrorless camera. Some thing the pentaprism actually operates better than the electronic viewfinder of mirrorless cameras.

Explanation:

7 0
3 years ago
Read 2 more answers
When making an assembly of design what command is most.commonly used?
Schach [20]
There are two common command lines used in creating design assembly. The 'push' and 'pull' command. Both allows you to get parts from the original predelivered content's source desgian    and recreate the design faster and with less memory.
6 0
3 years ago
Write an algorithm to sum to values
Elis [28]

Answer:

There is no need to make an algorithm for this simple problem. Just add the two numbers by storing in two different variables as follows:

Let a,b be two numbers.

c=a+b;

print(c);

But, if you want to find the sum of more numbers, you can use any loop like for, while or do-while as follows:

Let a be the variable where the input numbers are stored.

while(f==1)

{

printf(“Enter number”);

scanf(“Take number into the variable a”);

sum=sum+a;

printf(“Do you want to enter more numbers? 1 for yes, 0 for no”);

scanf(“Take the input into the variable f”);

}

print(Sum)

Explanation:

hi there answer is given mar me as brainliest

5 0
3 years ago
I have no idea, this has two parts. Any help I would love.
lana [24]

Answer:

2that is the question??? then many I could help

7 0
3 years ago
Other questions:
  • Write a function stats that takes an array and the number of elements in the array. Then, it computes and prints the minimum val
    8·1 answer
  • If we ignore the audio data in a video file, a video file is just a collection of many individual frames (i.e., images). What is
    6·1 answer
  • Create a Flowchart and write pseudocode for a program that allows the user to enter two integer values: a and b.
    8·1 answer
  • Charles was supposed to present his PowerPoint slides to his classmates in a classroom, but now he has to present in the auditor
    12·2 answers
  • #done with school already
    14·1 answer
  • Can someone please help me answer the extension activity and the exit ticket. I’ll award you. Thanks❤️.
    12·1 answer
  • Which conditions make using an array a better choice than a list? Select 3 options.
    12·2 answers
  • How do we prevent electrical problems as prescribe by the course?​
    11·1 answer
  • Your friend decides to create a spreadsheet containing vocabulary terms and their definitions to help prepare for the unit test
    5·1 answer
  • The principle of ________ strongly suggests that programs should execute with the least amount of privileges needed to complete
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!