배열 목록에 값을 할당하는 중 어려움에 직면하고 있습니다. 내 코드입니다 : 내가 배열 목록에 attrs.get("department") + attrs.get("description")+ attrs.get("name")+attrs.get("mail")
각각의 값을 할당 할arraylist에 결과 추가
while (answer.hasMore()) {
SearchResult rslt = (SearchResult)answer.next();
Attributes attrs = rslt.getAttributes();
System.out.println();
if (attrs.get("department") != null && attrs.get("telephonenumber") != null) {
System.out.println(attrs.get("department") + " " + attrs.get("name") + " " +
attrs.get("Description") + " " + attrs.get("mail") + " " +
attrs.get("telephonenumber")+
attrs.get("samaccountname") + attrs.get("samaccountname"));
}
.
String[] name = new String[100];
을하고 난 이름 속성을 읽으려고 while 루프에서, 나는하려고 노력 :
나는 처음에 정의하려고name = attrs.get("name");
그러나 그것은 작동하지 않았다. 누구든지 도와 줄 수 있어요.
작업을 수행하면 컴파일 오류가 발생 했습니까? 나는'attrs.get()'이'String'을 리턴한다고 의심한다. – hmjd
'attrs.get ("name");'문자열을 반환합니까? String 배열에 String을 할당 할 수 없습니다. 같은 배열에 다른 속성을 지정하는 것이 실제로 의미가 없기 때문에 질문을 편집하여 실제로 수행하려고하는 것을 나타낼 수 있습니다. – Perception