Tried printing Hello. But nothing was printed on console. It returned the value as (void). Suggest a solution
Attached the expression as image.
@Service("DetailsDAO")
public class DetailsDAOImpl implements DetailsDAO {
private static final Logger logger = Logger.getLogger(DetailsDAOImpl.class);
@Override
public List < DetailsVO > getDetails(String name) {
System.out.println("Hello");
logger.info("Hello");
List < DetailsVO > detailList = new ArrayList < DetailsVO > ();
DetailsVO detVo = new DetailsVO();
detVo.setAdd1("abc");
detVo.setAdd2("qwe");
detailList.add(detVo);
return detailList;
}
}
答案 0 :(得分:-1)
Your problem is not very clear and i suggest you post some code.
A simple Hello World program looks like this:
public class Main {
public static void main(String [] args) {
System.out.println("Hello World!");
}
}
Please note that System.out.println
does not return anything, it simply does what its name means: Print a line on the console.