Java Stream API — Even Numbers (Full Screen) Java Stream API — Get Even Numbers Example 1 — Filter even numbers from a list Creates a list, uses Stream to filter evens, and prints them. Copy import java.util.*; import java.util.stream.*; public class EvenNumbersStream { public static void main(String[] args) { // Create a list of numbers List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); // Use Stream API to filter even numbers List<Integer> evenNumbers = numbers.stream() .filter(n -> n % 2 == 0) .collect(Collectors.toList()); // Print the even numbers System.out.println( "Even numbers: " + evenNumbers); } } Example 2 — Use IntStream.rangeClosed ...
Download the 2017 Hon. Question Paper. COMPUTER SCIENCE - HONOURS [Part - III : 3rd Year] FIFTH PAPER - 2017 Full Marks - 100 Answer Question No. 1 and any five questions from the rest taking at least one from each group 1. Answer any ten questions : (marks 2 X 10) (a) Distinguish between software interrupt and non-muskable interrupt. (b) Why is data bus bidirectional ? (c) Mention the differences between JZ and JNZ. (d) What is DMA ? (e) What is Bus Arbitration ? (f) What is the funtion of 8279 ? (g) What is the differences between opcode and operand ? (h) What is ROM BIOS ? (i) What is Client-Server model ? (j) What is router ? (k) What is MAC address ? (l) What is Shannon's capacity ? (m) What is the difference between bit rate and baud rate ? (n) What is the difference between guided and unguided media ? (o) What is E-mail ? Group - A 2.(a) Discuss the functions of the following signals of 8085 microprocessor : IO/ M , INTR, HOLD, ...