<< Prev Question Next Question >>

Question 28/89

Given:
class Student {
String course, name, city;
public Student (String name, String course, String city) {
this.course = course; this.name = name; this.city = city;
}
public String toString() {
return course + ":" + name + ":" + city;
}
public String getCourse() {return course;}
public String getName() {return name;}
public String getCity() {return city;}
and the code fragment:
List<Student> stds = Arrays.asList(
new Student ("Jessy", "Java ME", "Chicago"),
new Student ("Helen", "Java EE", "Houston"),
new Student ("Mark", "Java ME", "Chicago"));
stds.stream()
.collect(Collectors.groupingBy(Student::getCourse))
.forEach(src, res) -> System.out.println(res));
What is the result?

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Question List (89q)
Question 1: Given the code fragment: (Exhibit) What is the result?...
Question 2: Given: public class Customer { private String fName; private...
Question 3: Given the code fragment: (Exhibit) You have been asked to de...
Question 4: Given the code fragment: List&lt;String&gt; empDetails = Arr...
Question 5: Given: class ImageScanner implements AutoCloseable { public ...
Question 6: Given: Item table * ID, INTEGER: PK * DESCRIP, VARCHAR(100) ...
Question 7: Given the code fragment: List&lt;Integer&gt; nums = Arrays.a...
Question 8: Given the code fragment: List&lt;String&gt; nL = Arrays.asLi...
Question 9: Given: class Vehicle implements Comparable&lt;Vehicle&gt;{ i...
Question 10: Given the code fragment: BiFunction&lt;Integer, Double, Inte...
Question 11: Given: (Exhibit) What is the result?...
Question 12: Given the code fragment: (Exhibit) What is the result?...
Question 13: Given: class Student { String course, name, city; public Stu...
Question 14: Given: (Exhibit) and the code fragment: (Exhibit) Assuming c...
Question 15: You want to create a singleton class by using the Singleton ...
Question 16: Given the content of the files: (Exhibit) Given the code fra...
Question 17: Given the code fragment: LocalDate valentinesDay =LocalDate....
Question 18: Assume customers.txt is accessible and contains multiple lin...
Question 19: Given the code fragment: Stream&lt;List&lt;String&gt;&gt; iS...
Question 20: Given records from the Player table: (Exhibit) and given the...
Question 21: Given: class Book { int id; String name; public Book (int id...
Question 22: Given the content of /resourses/Message.properties: welcome1...
Question 23: Given the code fragment: (Exhibit) What is the result?...
Question 24: Given the code fragment: List&lt;Double&gt; doubles = Arrays...
Question 25: Which two statements are true about synchronization and lock...
Question 26: Given the code fragment: public void recDelete (String dirNa...
Question 27: Given the code fragment: (Exhibit) Which statement can be in...
Question 28: Given: class Student { String course, name, city; public Stu...
Question 29: Given: (Exhibit) Which option fails?...
Question 30: Given the code fragments: class TechName { String techName; ...
Question 31: You have been asked to create a ResourceBundle which uses a ...
Question 32: Given: class Worker extends Thread { CyclicBarrier cb; publi...
Question 33: Given the code fragment: (Exhibit) What is the result?...
Question 34: Given: (Exhibit) What is the result?...
Question 35: Given: class FuelNotAvailException extends Exception { } cla...
Question 36: Given: class UserException extends Exception { } class AgeOu...
Question 37: Given the code fragments: (Exhibit) and (Exhibit) What is th...
Question 38: Given: class Book { int id; String name; public Book (int id...
Question 39: Given the code fragment: Path path1 = Paths.get("/app/./sys/...
Question 40: Given the code fragment: (Exhibit) and the information: * Th...
Question 41: Given the code fragment: (Exhibit) Assume that dbURL, userNa...
Question 42: Given the code fragment: Stream&lt;Path&gt; files = Files.wa...
Question 43: Given: class RateOfInterest { public static void main (Strin...
Question 44: Given the content of the employee.txt file: Every worker is ...
Question 45: Given the code fragment: 9. Connection conn = DriveManager.g...
Question 46: Given: Book.java: public class Book { private String read(St...
Question 47: Given the code fragment: (Exhibit) What is the result?...
Question 48: Given: class Sum extends RecursiveAction { //line n1 static ...
Question 49: Given the code fragment: List&lt;String&gt; empDetails = Arr...
Question 50: Given the code fragment: Map&lt;Integer, String&gt; books = ...
Question 51: Given: public final class IceCream { public void prepare() {...
Question 52: (Exhibit) What is the result?
Question 53: Given: class Vehicle { int vno; String name; public Vehicle ...
Question 54: Given the code fragment: Path source = Paths.get ("/data/dec...
Question 55: Given the code fragment: LocalDate valentinesDay =LocalDate....
Question 56: Which two code blocks correctly initialize a Locale variable...
Question 57: The data.doc, data.txt and data.xml files are accessible and...
Question 58: Given the content: (Exhibit) and given the code fragment: (E...
Question 59: Given the code fragment: Path path1 = Paths.get("/app/./sys/...
Question 60: Given: (Exhibit) and this code fragment: (Exhibit) What is t...
Question 61: Given this code; (Exhibit) Which two are correct after this ...
Question 62: Which two statements are true about localizing an applicatio...
Question 63: Which statement is true about the DriverManager class?...
Question 64: Given the content of /resourses/Message.properties: welcome1...
Question 65: Given the code fragments: class Caller implements Callable&l...
Question 66: Given: public class product { int id; int price; public Prod...
Question 67: Given the code fragment: List&lt;String&gt; colors = Arrays....
Question 68: Given: public class Counter { public static void main (Strin...
Question 69: Which two methods from the java.util.stream.Stream interface...
Question 70: Given the structure of the EHF and DEPT tables: (Exhibit) Gi...
Question 71: Given: public interface Moveable&lt;Integer&gt; { public def...
Question 72: Which two statements are true about the Fork/Join Framework?...
Question 73: Given the code fragment: class CallerThread implements Calla...
Question 74: Which statement is true about java.util.stream.Stream?...
Question 75: (Exhibit) and the code fragment? (Exhibit) What is the resul...
Question 76: Assume customers.txt is accessible and contains multiple lin...
Question 77: Given: (Exhibit) and the code fragment: (Exhibit) Which two ...
Question 78: Given that these files exist and are accessible: /sports/inf...
Question 79: Given that course.txt is accessible and contains: Course : :...
Question 80: Given the content: (Exhibit) and the code fragment: (Exhibit...
Question 81: Given the code fragment: List&lt;Integer&gt; codes = Arrays....
Question 82: Given that course.txt is accessible and contains: Course : :...
Question 83: Given the code fragment: (Exhibit) Assume that the value of ...
Question 84: Given: public class Product { int id; int price; public Prod...
Question 85: Which statement is true about the single abstract method of ...
Question 86: Given that /green.txt and /colors/yellow.txt are accessible,...
Question 87: Given: class CheckClass { public static int checkValue (Stri...
Question 88: Given: IntStream stream = IntStream.of (1,2,3); IntFunction&...
Question 89: Which statement is true about the single abstract method of ...