Code Monkey home page Code Monkey logo

1z0819-notes's Introduction

My personal OCP 1z0819 notes preparation notes

Exam Preparation Resources

Books

Additionals

Notes

  • var declaration is allowed only inside method body and for loop declarations. It is not allowed to declareclass/instance fields, method parameters, or method return types.

  • Function<T,R> is a functional interface whose functional method is apply(Object). If you have a method that expects this function, for example: void myMethod(Function< Integer, String> f){   ... } it can be invoked like this: myMethod( i -> "create some string here" );

  • Class Initialization order:

    1. All static constants, variables, and blocks.
    2. All non static constants, variables, and blocks.
    3. Constructor.
  • Static method cannot be overridden by a non-static method and vice versa.

  • If there is no package statement in the source file, the class is assumed to be created in an unnamed package that has no name. In this case, all the types created in this package will be available to this class without any import statement.

  • Since Integer is a subtype of Number, List< Integer > is a subtype of List<? extends Integer> and List<? extends Integer> is a subtype of List<? extends Number>. Thus, if an overridden method returns List<? extends Integer>, the overriding method can return List < Integer > but not List< Number > or List<? extends Number>.

  • Primitives are always passed by value.

  • Java 11 has a new feature called the "Single-File Source-Code program".  This feature allows executing your Java source code directly using the java interpreter. The source code is compiled in memory and then executed by the interpreter. The limitation is that all the classes have to be defined in the same file. The class to be executed is the first top-level class found in the source file. It must contain a declaration of the standard main method.

  • A superclass object can never be assigned to a base class reference.

    Plant p = new Sunflower(); //Valid
    
    Sunflower s = new Plant(); // Doesnt compile

1z0819-notes's People

Contributors

ilkin0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.