Tutorial by Topics: a

The nameof operator allows you to get the name of a variable, type or member in string form without hard-coding it as a literal. The operation is evaluated at compile-time, which means that you can rename a referenced identifier, using an IDE's rename feature, and the name string will update with i...
In order to be able to use the unsafe keyword in a .Net project, you must check "Allow unsafe code" in Project Properties => Build Using unsafe code can improve performance, however, it is at the expense of code safety (hence the term unsafe). For instance, when you use a for lo...
When deciding on how to create a property, start with an auto-implemented property for simplicity and brevity. Switch to a property with a backing field only when circumstances dictate. If you need other manipulations beyond a simple set and get, you may need to introduce a backing field.
The Java programming language is... General-purpose: It is designed to be used for writing software in a wide variety of application domains, and lacks specialized features for any specific domain. Class-based: Its object structure is defined in classes. Class instances always have those...
If you want to learn more about the Android Gradle Plugin setting check out the android-gradle Documentation. If you are interested in alternative emulators, you could look at Genymotion. It provides a free plan and requires smaller amount of RAM. VersionAPI LevelVersion CodeRelease Date1.01B...
Inheritance is a basic object oriented feature in which one class acquires and extends upon the properties of another class, using the keyword extends. For Interfaces and the keyword implements, see interfaces. class ClassB extends ClassA {...} class ClassB implements InterfaceA {...} interf...
A Stream represents a sequence of elements and supports different kind of operations to perform computations upon those elements. With Java 8, Collection interface has two methods to generate a Stream: stream() and parallelStream(). Stream operations are either intermediate or terminal. Intermediate...
Objects of type Throwable and its subtypes can be sent up the stack with the throw keyword and caught with try…catch statements. void someMethod() throws SomeException { } //method declaration, forces method callers to catch if SomeException is a checked exception type try { someMethod();...
Lambda expressions provide a clear and concise way of implementing a single-method interface using an expression. They allow you to reduce the amount of code you have to create and maintain. While similar to anonymous classes, they have no type information by themselves. Type inference needs to happ...
A layout defines the visual structure for a user interface, such as an activity or widget. A layout is declared in XML, including screen elements that will appear in it. Code can be added to the application to modify the state of screen objects at runtime, including those declared in XML. and...
Gradle is a JVM-based build system that enables developers to write high-level scripts that can be used to automate the process of compilation and application production. It is a flexible plugin-based system, which allows you to automate various aspects of the build process; including compiling and ...
The NavigationView represents a standard navigation menu for application. The menu contents can be populated by a menu resource file. Before using the NavigationView you must add the design support library dependency in the build.gradle file: dependencies { compile 'com.android.support:de...
Arrays allow for the storage and retrieval of an arbitrary quantity of values. They are analogous to vectors in mathematics. Arrays of arrays are analogous to matrices, and act as multidimensional arrays. Arrays can store any data of any type: primitives such as int or reference types such as Object...
An interface is a reference type, similar to a class, which can be declared by using interface keyword. Interfaces can contain only constants, method signatures, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods. Like abstract classes...
The java.util.Map interface represents a mapping between keys and their values. A map cannot contain duplicate keys; and each key can map to at most one value. Since Map is an interface, then you need to instantiate a concrete implementation of that interface in order to use it; there are several M...
Object : An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma). Array : An array is an ordered collection of values. An array begins with [...
int read(byte[] b) throws IOException Note that most of the time you do NOT use InputStreams directly but use BufferedStreams, or similar. This is because InputStream reads from the source every time the read method is called. This can cause significant CPU usage in context switches into an...
Setup Before using data binding, you must enable the plugin in your build.gradle. android { .... dataBinding { enabled = true } } Note: Data binding was added to the Android Gradle plugin in version 1.5.0 Binding class names The data binding plugin generates a bind...
Default Method introduced in Java 8, allows developers to add new methods to an interface without breaking the existing implementations of this interface. It provides flexibility to allow the interface to define an implementation which will be used as default when a class which implements that inter...

Page 3 of 320