Java-Part 7

JDBC   Index   Java-Part 8
*A variable is an identifier that denotes the storage location, used  to store a data value unlike constants that remain unchanged, during execution of a program, a variable may take different values at different times during program execution.

*We can make integers long by appending the letter “L” or “l” to the end of integer.

*The float type values are single precession numbers, while double type represents the double precession numbers.

*Floating point numbers are treated as double precession quantities. To force them to be in single precession mode we must append them “F” or “f” eg:- 1.23F or 7.5692e5f.

*Even though java char type uses 16 bit to represent uni code character set, the typical format for Strings on the internet uses arrays of 8 bit bytes constructed from ASCII character set.

*equals() method compares the characters inside a String object. The == operator compares 2 object references to see wether they refer to the same instance.

*StringBuffer => String.valueOf() is called for each parameter to obtain its string representation. The result is appended to the StringBuffer object.

*The “void” class has one field “TYPE” which holds the reference to the “class” object for the type void. You don’t create instances of this class.

*Iterator enables you to cycle through a collection, obtaining or removing elements.

*ListIterator extends Iterator enables bidirectional traversal of list & can modify the contents also.

*Map.Entry =>Describes an element (key, value) in a Map. This is inner class of Map.

*RandomAccess is implemented by both ArrayList & Vector.

*The Map.Entry interface enables you to work with a Map entry. Recall that the entryset() method declared by the Map interface returns the set containing the Map entries.

*Each of these Set elements is Map.Entry object.

*Iterator ->next() ->returns element                                                                                           Enumeration->nextElement()->returns generic object reference

*Hastable can only store object that override hashcode() & equals() method that are defined by the Object class.

*StringTokenizer implements the Enumeration interface.

*Most Http servers will append a file named index.html or index.htm to the URL that refer directly to a directory resource.

*for ServerSocket the default client connection is 50.

*In HTML, the schema for HTML would be the HTML language definition itself.

*HTML browsers ignore tags that they don’t understand.

*xmlprologue

*Name spaces provide a way to separate tags into groups using Uniform Resource Identifiers.

*Name spaces can be identified within the prologue of the document.

*Synchronized used only for method level.

*abstract can’t be combined with the following.

  • final
  • strictfp
  • private
  • static
  • synchronized
  • native

keywordsplus

*native applies only to methods, strictfp applies only to class and methods(IEEE754).

*with strictfp you can predict how your floating point will behave regardless of underlying platform the JVM running on.

*A variable can’t be declared as strictfp.

* There is no final objects, only final references. A reference variable holds bits that represent in a platform dependent manner.

*transient can be applied only to instance variables.

*volatile applied only to instance variables.

*the rule is, a static method of a class can’t access a non static(instance) member, method or variable of its own class.

*static methods can’t be overridden.

*Interface methods can’t be

  • final
  • static
  • native
  • strictfp
  • synchronized

*For floating point values, divide by zero return either ‘+infinity’/’-infinity’.

*The result of an unsigned right shift is always positive, regardless of the original sign bit.

*shift operators can only be used on ints.

*Bitwise operator may not be applied to float & double.

*we can’t use ‘-‘ with boolean.

ListSet

*When you are using “Locale” object, you need to specify language code according to the “ISO-639” language code.[Its having 2 letters].

*Inner classes can be

  • final
  • abstract
  • public
  • private
  • protected
  • static

*Method local inner classes can’t be

  • public 
  • private
  • protected
  • static
  • transient

*only abstract & final can apply for method local inner classes.

char
JDBC   Index   Java-Part 8

2 thoughts on “Java-Part 7

Leave a comment