Search Results

Search found 2 results on 1 pages for 'user1055638'.

Page 1/1 | 1 

  • Why are static imports of static methods with same names legal?

    - by user1055638
    Lets say we have these packages and classes: package p1; public class A1 { public static void a() {} } package p2; public class A1 { public static void a() {} } package p3; import static p1.A1.a; import static p2.A1.a; public class A1 { public static void test() { } } I am wondering, why the static import of methods is legal (won't result in compile time error) in package p3? We won't be able to use them further in the test() method as such usage will result in the compile time error. Why it is not the same as with a normal import of classes. Lets say we would like to import classes A1 from packages p1 and p2 into p3: package p3; import p1.A1; import p2.A1; such import is illegal and will result in the compile time error.

    Read the article

  • How to group rows into two groups in sql?

    - by user1055638
    Lets say I have such a table: id|time|operation 1 2 read 2 5 write 3 3 read 4 7 read 5 2 save 6 1 open and now I would like to do two things: Divide all these records into two groups: 1) all rows where operation equals to "read" 2) all other rows. Sum the time in each group. So that my query would result only into two rows. What I got so far is: select sum(time) as total_time, operation group by operation ; Although that gives me many groups, depending on the number of distinct operations. How I could group them only into two categories? Cheers!

    Read the article

1