Monday, March 8, 2010

Android books

To learn android, I've bought a books.This book is "L art du developpment Android".
This book was write by Mark Murphy.So fo the US, search Marc Murphy and you should see an equivalent.I put some links on my android blog MyAndroidBlog
So I will just summary advantages and drawbacks of this books :

Advantages :
- A lot of small chapter with exercises.
- Good explanation.
- Not too much eclipse 's configurations.Be careful, a lot of android's books speak a lot of about eclipse but not about developing with android.

Drawbacks.
- Some class are not write with best practices.
- Eclipse configuration.

So if you love developing java and you want to learn something different (Android) with me, you can see my blog : MyAndroidBlog

Wednesday, March 3, 2010

SCJP exercise : initialisation

Exercice :

 

Given the following :

public class Test {

    private int myvar=3;
    public Test(int myvar) {

        if (myvar == 5) {
            myvar = 2;
        } else {
            myvar =3;
        }
    }

    public void show() {
        System.out.println("myvar:" + myvar);
    }

    public static void main(String[] args) {
        Test test = new Test(4);
        test.show();
    }
}


What is the result (choose one) :
A: myvar:2
B: myvar:3
C: myvar:4
D: myvar:5
E: Compilation fails
F: An exception is thrown at runtime










Solution :

Thursday, February 25, 2010

Linux 2.6.33 released !

New linux kernel version : Annonce
If you want to have more details see : survey


Eclipse survey

An interesting survey about eclipse's use in the world was publish.It shows that Linux is use more and more (Linux 43%, Windows 41%).We learn also that Subversion is the source control that is the most use.And to finish,  89% of users are happy to use eclipse.Here is the complete survey :


SurveyEclipse


Wednesday, February 24, 2010

SCJP exercise : operators

Exercise :

public static void main(String [] args) {

int val = 5;
if ( (val && 7) == 2) {
System.out.println("Good");
} else {
System.out.println("Bad");
}
}

A Good
B Bad
C Compilation fails
D An exception is thrown at runtime










Solution :


The solution is C.The && oeprator can be use only with boolean.

Monday, February 22, 2010

Android

In this time, I prepare a blog about android.In this blog we will learn together android.I don't know android.So I will learn with you and I will put all my notes on my android blog : androidKillerApps

Wednesday, February 17, 2010

SCJP exercise : instanceof

Exercise :

public class Test {

public static void main(String [] args) {

Integer test = new Integer(5);
if (null instanceof Integer) {
System.out.println("null is an integer");
} else if ( test instanceof Integer) {
System.out.println("test is an integer");
} else {
System.out.println("Hello");
}
}

}


What is the result ? (choose one)

A
null is an integer
B test is an integer
C
Hello
D Compilation fails
E An exception is thrown at runtime





Solution :


The solution is B.You can write null instanceof integer with no compilation error.