Given: package ocjap; class Student{ String name; public Student(String name){ this.name=name; } } public class Test86 { public static void main(String[] args) { Student[] students=new Student[3]; students[1]=new Student("Richard"); students[2]=new Student("Donald"); for (Student s : students) { System.out.println(""+s.name); } } } What is the result? A. null Richard Donald B. Richard Donald C. ..
package ocjap; public class Arr64 { public static void main(String[] args) { int numbers[]; numbers=new int[2]; numbers[0]=10; numbers[1]=20; numbers=new int[4]; numbers[2]=30; numbers[3]=40; for(int x:numbers){ System.out.print(" "+x); } } } What is the result? A. 10 20 30 40 B. 0 0 30 40 C. Compliation fails. D. An exception is thrown at runtime. 정답: B 해설: int 배열이기 때문에 0으로 초기화 된다. 때문에 new int[..
Given the code fragment: package ocjap; public class arr49 { public static void main(String[] args) { int n[][] = { {1,3}, {2,4} }; for (int i = n.length-1; i >=0; i--) { for(int y : n[i]){ System.out.print(y); } } } } What is the result? A. 1324 B. 2313 C. 3142 D. 2413 정답: D 해설: package ocjap; public class arr49 { public static void main(String[] args) { int n[][] = { {1,3}, {2,4} }; System.out..
Given the code fragment package ocjap; public class Test12 { void readCard(int cardNo) throws Exception{ System.out.println("Reading Card"); } void checkCard(int cardNo) throws RuntimeException{ // line n1 System.out.println("Checking Card"); } public static void main(String[] args) { Test12 ex =new Test12(); int cardNo=12345; ex.checkCard(cardNo); // line n2 ex.readCard(cardNo); // line n3 } } ..
class Ideone { public static void main (String[] args) throws java.lang.Exception { // your code goes here int x=1; int y=0; if(x++ > ++y){ System.out.print("Hello "); }else{ System.out.print("Welcome "); } System.out.print("Log " + x + ":" + y); } } What is the result? A. Hello Log 1:0 B. Hello Log 2:1 C. Welcome Log 2:1 D. Welcome Log 1:0 정답: C 해설 x++ 는 나중에 더해지고 ++y는 먼저 더해진다. 아래 출력을 보면 명확해진다. ..
요새는 자바 개발할때 스프링 프레임워크를 많이 사용해서 스프링에서 제공하는 api 이용하면 쉽게 보낼 수 있다. 기존방식으로 하면.. 자바 smtp로 구글링 하면 대부분이 Session session = Session.getDefaultInstance(prop, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(user, password); } }); 이런식으로 많이 되어 있다. 하지만.. 컴파일시 이너클래스에 의해 $1.class가 본인도 모르게 만들어 진다. 이게 큰문제를 일으킨다.. 리눅스 서버 에서는 $가 예약어 이다..
자바 smtp 메일 보낼때 송신자에 원하는 이름을 세팅하고 싶을 때가 있다. 이름을 세팅안하면 그냥 보낸사람 이메일 주소가 나온다. 보기 싫으니.. 이름을 세팅하고 싶다면 MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress("이메일주소","홍길동","UTF-8")); 이렇게 쓰면 보내는 사람 이메일 주소는 "이메일주소" 이고 이름 출력은 "홍길동" 으로 나온다.
마리아 db mysqldump시 "Access denied for user 'username'@'localhost' (using password: NO)" when trying to connect 오류가 발생했다. 사용자가 접속하려고 했을때 접근이 거부 되었다고 나오는것 같다. 그럼 권한이 없는듯.. 구글링을 해보니 GRANT ALL PRIVILEGES ON mydb.* TO 'username'@'%' IDENTIFIED BY 'password'; 이렇게 나왔다. 말그대로 모든 권한을 사용자에게 줘라 하는 명령어인듯 하다. 아직 해보진 않았지만 해보고 결과를 남기겠다.
- Total
- Today
- Yesterday
- 포인터
- php
- Python
- 인포믹스
- EC
- 파이썬
- KG
- ocajp
- C
- 오라클
- 스크래핑
- MySQL
- 프로씨
- webix
- 플러터
- JDBC
- 자바 smtp
- C언어
- 파싱
- XE3
- esql
- 자바
- xe애드온
- 라이믹스
- proc
- 이클립스
- xe addon
- 문자열
- ocjap
- XE
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
