Integer Turn to LONG Type data Hydra

2023-01-30   ES  

Intege data has a longvalue () function, which can be converted into the data of the Long type

code is as follows:

public static void main(String args[]) {

        Integer a = 1;
        System.out.println(a);
        long b = a.longValue();
        System.out.println(b);
        List<Integer> aList=new ArrayList<>();
        Integer a1 = 2;
        Integer a2 = 3;
        aList.add(a);
        aList.add(a1);
        aList.add(a2);
        List<Long> bList = new ArrayList<>();
        aList.stream().forEach(item->{

            long temp = item.longValue();            
            bList.add(temp);
        });
        System.out.println(bList);        
    }

Run results:

1
1
[1, 2, 3]

source

Random Posts

One Activity loads multiple layout layout files respectively

elasticse error-Bootstrap Checks Failed

Use Supervisor to manage the SWOFT process

Randomly select one Public # ls | shuf -n1 Videos # ls | shuf -n1 Templates # ls | shuf -n1 Downloads

WeChat Mini Program-SWIPER picture is incomplete