Tag Archives: method
Given: (Exhibit) Which two method implementations are correct, when inserted independently in line 1?
Given: (Exhibit) Which two statements are true if the method is added to Bar? (Choose two.)
Given:Which two statements are true if the method is added to Bar? (Choose two.) A. public Collection<String> foo(Collection<String> arg) { … } overrides Foo.foo. B. public <T> Collection<T> foo(Collection<T> arg) { … } overloads Foo.foo. C. public <T> List<T> foo(Collection<T> arg) { … } overrides Foo.foo. D. public <T> Iterable<T> foo(Collection<T> arg) { … } overrides Foo.foo. E.… Read More »
Given the code fragment: Which two code snippets inserted independently inside print method print Mondial:
Analyze the code: (Exhibit) Which two options can you insert inside println method to produce Global:namescope?
Assuming the Widget class has a getPrice method, this code does not compile: (Exhibit) Which two statements,
Assuming the Widget class has a getPrice method, this code does not compile:Which two statements, independently, would allow this code to compile? (Choose two.) A. Replace line 4 with Stream<Widget> widgetStream = widgets.stream();. B. Replace line 5 with widgetStream.filter(a > ((Widget)a).getPrice() > 20.00). C. Replace line 1 with List<Widget> widgetStream = widgets.stream();. D. Replace line 5 with widgetStream.filter((Widget… Read More »
Given: (Exhibit) and (Exhibit) Which two method definitions at line n1 in the Bar class compile? (Choose
Given:andWhich two method definitions at line n1 in the Bar class compile? (Choose two.) A. public List<Object> foo(Set<CharSequence> m) {…} B. public List<Integer> foo(Set<CharSequence> m) {…} C. public List<Number> foo(Set<String> m) {…} D. public ArrayList<Integer> foo(Set<String> m) {…} E. public List<Integer> foo(TreeSet<String> m) {…} F. public ArrayList<Number> foo(Set<CharSequence> m) {…} Correct Answer: E,F
Given: (Exhibit) Which two statements are true if the method is added to Bar? (Choose two.)
Given:Which two statements are true if the method is added to Bar? (Choose two.) A. public <T> Collection<T> bar(Collection<T> arg) { … } overloads Foo.foo. B. public <T> Collection<T> foo(Collection<T> arg) { … } overloads Foo.foo. C. public <T> Iterable<T> foo(Collection<T> arg) { … } overrides Foo.foo. D. public <T> Collection<T> foo(Stream<T> arg) { … } overloads Foo.foo.… Read More »