Code Monkey home page Code Monkey logo

53_idiosyncraticmethods's Introduction

process elements of a list of disparate types

...using methods that apply to only a single type.

organization

The important thinking/ learning here concerns...

  • What information is available to the compiler when it compiles a .java file?
  • What information is available to the JVM when it runs the instructions that the compiler produces?

The assignment attempts to help people think about these questions by...

  • isolating catElementsStartingWith, into a file (Accumulator.java) away from all the other code; and...
  • asking you to compile that file separately, with a command like javac Accumulator.java.

Maybe this isolation can help people understand that the compiler only knows what it can infer from that file and any .class files it depends on.

For example the compiler knows nothing about the data in a list. That data can change when the programmer changes UserOfList.java, after compiling Accumulator.java. So the compiler can make no decisions that required knowing the data. The user of Accumulator could make a list that contained only Strings. But the compiler cannot know that. So the compiler's decisions on what Java code is ok cannot depend on the type of data in the list.

The compiler always compiles one file at a time, even when you issue a command like javac UserOfList.java that can result in its compiling compiling several in succession. So the thinking done in this assignment is broadly useful.

53_idiosyncraticmethods's People

Contributors

amy-lei avatar

Watchers

 avatar  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.