java2

Embed Size (px)

DESCRIPTION

assa

Citation preview

  • java random, c++ not.random method - generates a value from zero < 1another random is under class and more powerfull, cause can generate intgr double n etcc1. System.out.println((int)Math.random()*48+1); --means value from 0 -47

    overloaded -for int - only one and

    avoid putting many classes in one file.. dont follow slide 16interface is a special type of class - lecture 3, lab 4,6,7==> above is called polymorphismlong x = 10;int y = 10.0 //wrong - only allowed when two data types are the same

    only big one can take small one -refer drawingparent can take child, child cant take parent

    int z = 10L --wrong

    extends = is A (meaning)t,f,f,t,t,t

    JAVA API --LANG - STRING - can use all classes there

    when a string is replace ,it will get 'garbage collection' - only in java, not c++immutable - xmen

    2ways -