ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
Complete Interview Preparation Material: topmate.io/genzcareer/930954Interview Preparation Kit: topmate.io/genzcareer/959954I would recommend you to get above Interview Preparation kit and crack any interview [99% Chance]
Thanks for the free content, this is really helpful for Java interview prep.
Good Questions. Thank you for providing free content ❤
Wow, this one was hard, questions weren't straight forwardHe did great for 3 years experiance guy👍
WAP To print the sum of alternate indices of an array List asList = Arrays.asList(1,2,3,4,5,6,7,8,9,10); int sum = IntStream.range(0, asList.size()).filter(x->x%2!=0).map(i->asList.get(i)).sum(); System.out.println(sum); use intstream
Materials pdf or videos plz let me know ?
List l1 = Arrays.asList(7,1,5,3,6,4);System.out.println(l1.stream().filter(x->l1.indexOf(x)%2==1).reduce(Integer::sum));
Which are the topics covered you in this pdf ?
@@jitendrakumar-fg4ll everything
@@genz-career there is any index
public static void main(String[] args) { List numbers = Arrays.asList(10, 20, 30, 11, 21, 31); System.out.println(sum(numbers)); } public static int sum(List numbers) { return (int) numbers.stream().collect(Collectors.partitioningBy(num -> num % 2 == 0)).get(true).stream() .collect(Collectors.summarizingInt(Integer::intValue)).getSum(); }
Complete Interview Preparation Material: topmate.io/genzcareer/930954
Interview Preparation Kit: topmate.io/genzcareer/959954
I would recommend you to get above Interview Preparation kit and crack any interview [99% Chance]
Thanks for the free content, this is really helpful for Java interview prep.
Good Questions.
Thank you for providing free content ❤
Wow, this one was hard, questions weren't straight forward
He did great for 3 years experiance guy👍
WAP To print the sum of alternate indices of an array
List asList = Arrays.asList(1,2,3,4,5,6,7,8,9,10);
int sum = IntStream.range(0, asList.size()).filter(x->x%2!=0).map(i->asList.get(i)).sum();
System.out.println(sum); use intstream
Materials pdf or videos plz let me know ?
List l1 = Arrays.asList(7,1,5,3,6,4);
System.out.println(l1.stream().filter(x->l1.indexOf(x)%2==1).reduce(Integer::sum));
Which are the topics covered you in this pdf ?
@@jitendrakumar-fg4ll everything
@@genz-career there is any index
public static void main(String[] args) {
List numbers = Arrays.asList(10, 20, 30, 11, 21, 31);
System.out.println(sum(numbers));
}
public static int sum(List numbers) {
return (int) numbers.stream().collect(Collectors.partitioningBy(num -> num % 2 == 0)).get(true).stream()
.collect(Collectors.summarizingInt(Integer::intValue)).getSum();
}