본문 바로가기

분류 전체보기122

스트림의 이해와 생성 ● 첫번째 예제 package org.example; import java.util.Arrays; import java.util.List; import java.util.stream.IntStream; import java.util.stream.Stream; public class Main { public static void main(String[] args) { int ar[] = {1, 2, 3, 4, 5}; IntStream stm1 = Arrays.stream(ar); stm1.forEach(System.out::println); // 매서드 참조형 식 // stm1.forEach(s -> System.out.println(s)); 이거와 똑같다 // Arrays.steam(ar).forEach.. 2024. 2. 15.
C# 콘솔 콘솔 애플리케이션을 사용해본다. namespace WinFormsApp3 { public partial class Form1 : Form { private Button button1; private Button button2; public Form1() { InitializeComponent(); button1 = new Button(); // // button1 // button1.Location = new Point(440, 122); button1.Name = "button1"; button1.Size = new Size(162, 86); button1.TabIndex = 0; button1.Text = "button1"; button1.UseVisualStyleBackColor = true; bu.. 2024. 2. 13.
oracle sql ex1 --커미션을 받는 사원의 수를 구하시오. select count(*) from emp where comm is not null; ex2 --부서번호가 10인 사원중에 커미션을 받는 사원의 수를 구하시오 select count(*) from emp where deptno=10 and comm is not null; ex3 --사원테이블에서 job의 종류는 몇 개인가? select count(*)from( select job from emp group by job ); ex4 --부서별로 급여의 최고액을 구한 후 급여가 많은 순서데로 정렬하시오 select deptno,max(sal) from emp group by deptno; --order by max(sal) desc; 내림차순 ex5 --부서.. 2024. 2. 13.
미리 정의되어 있는 함수형 인터페이스 ●Predicate package org.example; import java.util.Arrays; import java.util.List; import java.util.function.IntPredicate; import java.util.function.Predicate; public class Main { public static void main(String[] args) { List list = Arrays.asList(1,5,7,9,11,12); int s; s = sum(n -> n%2 ==0, list); System.out.println("짝수의 합"+s); s = sum(n -> n%2 != 0,list); System.out.println("혹수의 합"+s); } public st.. 2024. 2. 13.