Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the mistake of Java programmer's habitual thinking?

Shulou Source: shulou.com Published: 2022-06-02 04:04:33 09月30日 Update

This article mainly explains "what is the mistake of Java programmer's habitual thinking". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what is the mistake of Java programmer's habitual thinking.

The structure of the table is as follows:

T_SOME_TABLE {crowid varchar (36); zrmb float (7Magne3); zjdw float (7Phone3);}

Ask the following two pieces of code, which part will make an error and why?

Code snippet 1:

/ / the background code is as follows: String hqlStr= "select SUM (t.zrmb) AS SUM_1,SUM (t.zjdw) AS SUM_2 from T_SOME_TABLE t where 1x1"; List sumList=baseDao.find (hqlStr); / / hibernate implements the query HQL summary statement to return the result List request.setAttribute ("sumList", sumList); / / the foreground code is as follows: String sum1= "; String sum2=" ArrayList sumList=request.getAttribute ("sumList") = = null?null: (ArrayList) request.getAttribute ("sumList"); if (nullroomroomsumList) {for (int iTuno)

Tags: Code fragments errors results thinking inertia reality query program programmer field statement content foreground background array is in learning encapsulating running Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Docker Apple Shulou Technology MariaDB