Notice
Recent Posts
Tags
- LED
- dataflow modeling
- Recursion
- Comparator
- Method
- ATMEGA128A
- interrupt
- interface
- Shift Register
- behavioral modeling
- atmega 128a
- gpio
- normal mode
- Set
- structural modeling
- siso shift register
- Linked List
- fast pwm mode
- full adder
- ctc mode
- MUX
- Algorithm
- atmega 128
- half adder
- D Flip Flop
- verilog
- ring counter
- java
- structure
- Pspice
목록Formatting String (1)
거북이처럼 천천히
Java - String Formatting
1. %d (Format code)와 % 기호를 같이 사용할 경우 ex) "Loading is 50%" String 을 출력하고 싶다. System.out.println(String.format("Loading is %d%", 50)); 위 예문처럼 작성하였지만, 예상과 달리 오류(UnknownFormatConversionException)가 발생하였다. 그 이유는 문자열 포맷 코드인 %d와 기호 %가 같은 문자열에 존재할 경우, 기호 %를 표시하기 위해서는 %%으로 써야한다. 하지만, 문자열 포맷 코드가 문자열에 존재하지 않는다면 %는 홀로 작성해도 상관이 없다. System.out.println(String.format("Loading is %d%%", 50)); // Loading is 50% 출력..
Back-end/Java 개념
2022. 5. 30. 23:25