Notice
Recent Posts
Tags
- Set
- interrupt
- interface
- sequential logic circuit
- behavioral modeling
- half adder
- gpio
- Comparator
- ctc mode
- verilog
- dataflow modeling
- atmega 128
- behavior modeling
- LED
- normal mode
- full adder
- Method
- 4bit parallel adder
- 8bit timer/counter
- java
- structure
- structural modeling
- Algorithm
- Recursion
- fast pwm mode
- atmega 128a
- timer / counter
- MUX
- Linked List
- ATMEGA128A
목록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