Object Orientation in Java [closed]

0

I am new to Java and would like to understand how it works. Type, how to use classe within the other (and what is it called)?

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

For example: it is sending Bundle to the method but it is not a String nor a int or something like that. How does this work exactly?

And another. When we create a String variable, for example:

String a = "aa";

Why do not we need to use the new operator and what happens if we stop using it on any object?

    
asked by anonymous 04.06.2015 / 04:14

1 answer

2

Friend! Here the space is kind of short to explain everything! I suggest some workbook ( link ).

This method you've shown belongs to an Android project, right? So, who creates an instance is the application. That when initializing the screen .xml, send this Bundle to the method!

On the second question: When you do String a = "aa"; it is the same as String a = new String("aa"); , because when the compiler processes / read "" understands that as new String("");

    
04.06.2015 / 04:27