Labels

.NET Job Questions About Java Absract class Abstract class Abstract Class and Interface Aggregation ajax aop apache ofbiz Apache ofbiz tutrial Association authentication autocad basics batch Binary Tree bootstrap loader in java build Builder design pattern C++ Job Questions caching CallableStatement in java certifications Chain of responsibility Design pattern charts check parentheses in a string Classes classloader in java classloading concept code quality collage level java program Composition concurrency Concurrency Tutorial Converting InputStream to String Core Java core java concept core java interview questions Core Java Interview Questions Core Java Questions core java tutorial CyclicBarrier in Java data structures database Database Job Questions datetime in c# DB Db2 SQL Replication deserialization in java Design Patterns designpatterns Downloads dtd Eclipse ejb example/sample code exception handling in core java file handling injava File I/O vs Memory-Mapped Filter first program in spring flex Garbage Collection Generics concept in java grails groovy and grails Guice Heap hibernate Hibernate Interview Questions how-to IBM DB2 IBM DB2 Tutorial ide immutable Interceptor Interface interview Interview Questions for Advanced JAVA investment bank j2ee java JAVA Code Examples Java 7 java changes java class loading JAVA Classes and Objects Java Classloader concept Java classloading concept java cloning concept java collection Java collection interview questions Java Collections java concurrency Java CountDownLatch java definiton Java design pattern Java EE 5 Java EE 6 Java Exceptions Java file Java Garbage Collection Java generics Java Glossary java hot concept java immutable concept Java Interface Java interview Question java interview question 2012 java interview question answer Java Interview Questions Java Interview Questions and Answers java interview topic java investment bank Java Job Questions java multithreading java multithreading concept java new features Java Packages java proxy object java questions Java Serialization Java serialization concept java serialization interview question java session concept java string Java Swings Questions java synchronization java threading Java Threads Questions java tutorial java util; java collections; java questions java volatile java volatile interview question Java Wrapper Classes java.java1.5 java.lang.ClassCastException JavaNotes javascript JAX-WS jdbc JDBC JDBC Database connection jdk 1.5 features JDK 1.5 new features Concurrent HashMap JMS interview question JMS tutorial job JSESSIONID concept JSESSIONID interview Question JSF jsp JSP Interview Question JSP taglib JSTL with JSP Junit Junit Concept Junit interview question.Best Practices to write JUnit test cases in Java JVM Linux - Unix tutorial Marker Interfaces MD5 encryption and decryption messaging MNC software java interview question musix NCR java interview question Networking Job Questions news Object Serialization Objects ojdbc14.jar OOP Oracle Oracle SQL Query for two timestamp difference orm own JavaScript function call in Apache ofbiz Packages Palm Apps patterns pdf persistence Portal Portlet Spring Integration Prime number test in java programs Rails Reboot remote computers REST Ruby Sample application schema SCJP security Senior java developer interviews servlet3 servlets session tracking singleton design pattern Spring Spring 2.5 Framework spring ebook Spring framework concept spring MVC spring pdf Spring Security Spring Security interview questions SQL SQL performance SQL Query to create xml file Sql Query tuning ssis and ssrs StAX and XML string concept string immutable string in java strings struts Struts2 Struts2 integration synchronization works in java Technical Interview testing tips Tomcat top Tutorial Volatile in deep Volatile working concept web Web Developer Job Questions web services weblogic Weblogic Application Server websphere what is JSESSIONID xml XML parsing in java XML with Java xslt


Showing posts with label Core Java. Show all posts
Showing posts with label Core Java. Show all posts

Monday, 29 July 2013

Difference Between NoClassDefFoundError and ClassNotFoundException


According to Java doc

ClassNotFoundException is thrown when an application tries to load in a class through its string name using:

    The forName method in class Class.
    The findSystemClass method in class ClassLoader .
    The loadClass method in class ClassLoader.

     http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/ClassNotFoundException.html
  
Example:

package hardik4u;

public class ExpClassNotFound {

    public static void main(String[] args) {
       
        //i have tried to load class which is not exists using Class.forName
       
        try {
            Class.forName("hardik4u.TestDate");
        } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
           
        }
      
  }
}


while

NoClassDefFoundError is thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.

The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.

    http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/NoClassDefFoundError.html
  
Example:

package hardik4u;

public class ExpClassDefNotFound {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // Create one Class TestData in the same package
        // compile TestData and add below line in ExpClassDefNotFound class and compile it.
        // remove TestData.class and run
        // Java ExpClassDefNotFound
        // it will give ClassDefNot Found Error
       
       
        TestData testData =new TestData();

    }

}

Sunday, 28 July 2013

Difference between Comparator and Comparable in Java

Comparator in Java is defined in java.util package while Comparable
interface in Java is defined in java.lang package.

Comparator interface in Java has method public int compare
(Object o1, Object o2) which returns a negative integer, zero, or
a positive integer as the first argument is less than, equal to, or
greater than the second. While Comparable interface has method
public int compareTo(Object o) which returns a negative
integer, zero, or a positive integer as this object is less than, equal
to, or greater than the specified object.


If you see then logical difference between these two is
Comparator in Java compare two objects provided to him, while
Comparable interface compares "this" reference with the object
specified.


Comparable in Java is used to implement natural ordering of
object. In Java API String, Date and wrapper classes implement
Comparable interface.

If any class implement Comparable interface in Java then
collection of that object either List or Array can be sorted
automatically by using Collections.sort() or Arrays.sort() method
and object will be sorted based on there natural order defined by
CompareTo method

Example of Comparable
public class Person implements Comparable {
private int person_id;
private String name;

/**
* Compare current person with specified person
* return zero if person_id for both person is same
* return negative if current person_id is less than specified one
* return positive if specified person_id is greater than specified one
*/
public int compareTo(Person o) {
return this.person_id - o.person_id ;
}
….

}

Example of Comparator

package com.hardik4u.practice;
import java.util.Comparator;
public class MyIntComparable implements Comparator<Integer>{

@Override
public int compare(Integer o1, Integer o2) {
return (o1>o2 ? -1 : (o1==o2 ? 0 : 1));
}

}
And

package com.hardik4u.practice;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Simple2 {

public static void main(String[] args)
 {
List<Integer> list = new

ArrayList<Integer>();
list.add(5);
list.add(4);
list.add(3);
list.add(7);
list.add(2);
list.add(1);
Collections.sort(list, new
MyIntComparable());
for (Integer integer : list) {
System.out.println(integer);
}
}

Saturday, 27 July 2013

What is the difference between DTO and DAO


DAO is a class that usually has the CRUD operations like save, update, delete. DTO is just an object that holds data. It is JavaBean with instance variables and setter and getters.

A DAO can be thought of as a proxy used by the business tier who is its client to retrieve values from any given resource such as a RDMS, LDAP server, XML repository, OODB, flat files and so forth. Here is how it looks:

    your code -> DAO -> JDBC

The DTO, Value Object(VO) is used to expose several values in a bean like fashion. This provides a light-weight mechanism to transfer values over a network or between different application tiers.
 DTO will be passed as value object to DAO layer and DAO layer will use this object to persist data using its CRUD operation methods.

The advantage of the DAO layer is that if you need to change the underlying persistence mechanism you only have to change the DAO layer, and not all the places in the domain logic where the DAO layer is used from. The DAO layer usually consists of a smaller set of classes, than the number of domain logic classes that uses it. Should you need to change what happens behind the scene in the DAO layer, the operation is somewhat smaller, since it only affects the DAO layer.
   
The advantage of DTO layer is that it adds a good deal of flexibility to the service layer and subsequently to the design of the entire application. For example, if DTOs are used, a change in the requirements that forces a move to a different amount of data doesn't have any impact on the service layer or even the domain. You modify the DTO class involved by adding a new property, but leave the overall interface of the service layer intact.

Wednesday, 24 July 2013

How does HashMap works

HashMap has a number of "buckets" which it uses to store key-value pairs in. Each bucket has a unique number - that's what identifies the bucket. When you put a key-value pair into the map, the hashmap will look at the hash code of the key, and store the pair in the bucket of which the identifier is the hash code of the key. For example: The hash code of the key is 235 -> the pair is stored in bucket number 235. (Note that one bucket can store more then one key-value pair).


When you lookup a value in the hashmap, by giving it a key, it will first look at the hash code of the key that you gave. The hashmap will then look into the corresponding bucket, and then it will compare the key that you gave with the keys of all pairs in the bucket, by comparing them with equals().
Now you can see how this is very efficient for looking up key-value pairs in a map: by the hash code of the key the hashmap immediately knows in which bucket to look, so that it only has to test against what's in that bucket.
Looking at the above mechanism, you can also see what requirements are necessary on thehashCode() and equals() methods of keys:
  • If two keys are the same (equals() returns true when you compare them), their hashCode()method must return the same number. If keys violate this, then keys that are equal might be stored in different buckets, and the hashmap would not be able to find key-value pairs (because it's going to look in the same bucket).
  • If two keys are different, then it doesn't matter if their hash codes are the same or not. They will be stored in the same bucket, but the hashmap will use equals() to tell them apart.
References:

    Java class loading

    Thursday, 18 July 2013

    Two Minute Drills of SCJP – Kathy Sierra Part-2

    Encapsulation, IS-A, HAS-A
    • Encapsulation helps hide implementation behind an interface (or API).
    • Encapsulated code has two features:
    • Instance variables are kept protected (usually with the private modifier).
    • Getter and setter methods provide access to instance variables.
    • IS-A refers to inheritance or implementation.
    • IS-A is expressed with the keyword extends.
    • IS-A, "inherits from," and "is a subtype of " are all equivalent expressions.
    • HAS-A means an instance of one class "has a" reference to an instance of
    • Another class or another instance of the same class.

     

    Inheritance
    • Inheritance allows a class to be a subclass of a superclass, and thereby
    • Inherit public and protected variables and methods of the superclass.
    • Inheritance is a key concept that underlies IS-A, polymorphism, overriding, overloading, and casting.
    • All classes (except class Object), are subclasses of type Object, and therefore they inherit Object's methods.

    Polymorphism
    • Polymorphism means "many forms."
    • A reference variable is always of a single, unchangeable type, but it can refer to a subtype object.
    • A single object can be referred to by reference variables of many different types —as long as they are the same type or a supertype of the object.
    • The reference variable's type (not the object's type), determines which methods can be called!
    • Polymorphic method invocations apply only to overridden instance methods.

    Overriding and Overloading
    • Methods can be overridden or overloaded; constructors can be overloaded but not overridden.
    • Abstract methods must be overridden by the first concrete (non-abstract) subclass.
    • With respect to the method it overrides, the overriding method Must have the same argument list.
    • Must have the same return type, except that as of Java 5, the return type
    • can be a subclass—this is known as a covariant return.
    • Must not have a more restrictive access modifier.
    • May have a less restrictive access modifier.
    • Must not throw new or broader checked exceptions.
    • May throw fewer or narrower checked exceptions, or any unchecked exception.
    • final methods cannot be overridden.
    • Only inherited methods may be overridden, and remember that private methods are not inherited.
    • A subclass uses super.overriddenMethodName() to call the superclass version of an overridden method.
    • Overloading means reusing a method name, but with different arguments.
    • Overloaded methods Must have different argument lists
    • May have different return types, if argument lists are also different
    • May have different access modifiers
    • May throw different exceptions
    • Methods from a superclass can be overloaded in a subclass.
    • Polymorphism applies to overriding, not to overloading.
    • Object type (not the reference variable's type), determines which overridden method is used at runtime.
    • Reference type determines which overloaded method will be used at compile time.

     

    Reference Variable Casting
    • There are two types of reference variable casting: downcasting and upcasting.
    • Downcasting: If you have a reference variable that refers to a subtype object, you can assign it to a reference variable of the subtype. You must make an explicit cast to do this, and the result is that you can access the subtype's members with this new reference variable.
    • Upcasting: You can assign a reference variable to a supertype reference variable explicitly or implicitly. This is an inherently safe operation because the assignment restricts the access capabilities of the new variable.

    Implementing an Interface
    • When you implement an interface, you are fulfilling its contract.
    • You implement an interface by properly and concretely overriding all of the methods defined by the interface.
    • A single class can implement many interfaces.

    Return Types
    • Overloaded methods can change return types; overridden methods cannot, except in the case of covariant returns.
    • Object reference return types can accept null as a return value.
    • An array is a legal return type, both to declare and return as a value.
    • For methods with primitive return types, any value that can be implicitly converted to the return type can be returned.
    • Nothing can be returned from a void, but you can return nothing. You're allowed to simply say return, in any method with a void return type, to bust out of a method early. But you can't return nothing from a method with a non-void return type.
    • Methods with an object reference return type, can return a subtype.
    • Methods with an interface return type, can return any implementer.

    Constructors and Instantiation
    • A constructor is always invoked when a new object is created.
    • Each superclass in an object's inheritance tree will have a constructor called.
    • Every class, even an abstract class, has at least one constructor.
    • Constructors must have the same name as the class.
    • Constructors don't have a return type. If you see code with a return type, it's a method with the same name as the class, it's not a constructor.
    • Typical constructor execution occurs as follows:
      • The constructor calls its superclass constructor, which calls its superclass constructor, and so on all the way up to the Object constructor.
      • The Object constructor executes and then returns to the calling constructor, which runs to completion and then returns to its calling constructor, and so on back down to the completion of the constructor of the actual instance being created.
      • Constructors can use any access modifier (even private!).
      • The compiler will create a default constructor if you don't create any constructors in your class.
      • The default constructor is a no-arg constructor with a no-arg call to super().
      • The first statement of every constructor must be a call to either this() (an overloaded constructor) or super().
      • The compiler will add a call to super() unless you have already put in a call to this() or super().
      • Instance members are accessible only after the super constructor runs.
      • Abstract classes have constructors that are called when a concrete subclass is instantiated.
      • Interfaces do not have constructors.
      • If your superclass does not have a no-arg constructor, you must create a constructor and insert a call to super() with arguments matching those of the superclass constructor.
      • Constructors are never inherited, thus they cannot be overridden.
      • A constructor can be directly invoked only by another constructor (using a call to super() or this()).
      • Issues with calls to this() May appear only as the first statement in a constructor.
      • The argument list determines which overloaded constructor is called.
      • Constructors can call constructors can call constructors, and so on, but sooner or later one of them better call super() or the stack will explode.
      • Calls to this() and super() cannot be in the same constructor. You can have one or the other, but never both.


    Statics
    • Use static methods to implement behaviors that are not affected by the state of any instances.
    • Use static variables to hold data that is class specific as opposed to instance specific—there will be only one copy of a static variable.
    • All static members belong to the class, not to any instance.
    • A static method can't access an instance variable directly.
    • Use the dot operator to access static members, but remember that using a reference variable with the dot operator is really a syntax trick, and the compiler will substitute the class name for the reference variable, for instance:

    d.doStuff();

    becomes:

    Dog.doStuff();
    • static methods can't be overridden, but they can be redefined.

    Coupling and Cohesion
    • Coupling refers to the degree to which one class knows about or uses members of another class.
    • Loose coupling is the desirable state of having classes that are well encapsulated, minimize references to each other, and limit the breadth of API usage.
    • Tight coupling is the undesirable state of having classes that break the rules of loose coupling.
    • Cohesion refers to the degree in which a class has a single, well-defined role or responsibility.
    • High cohesion is the desirable state of a class whose members support a single, well-focused role or responsibility.
    • Low cohesion is the undesirable state of a class whose members support multiple, unfocused roles or responsibilities.

    Tuesday, 16 July 2013

    Java - Difference Between Stack and Heap

    What Is Heap?
    The Java virtual machine has a heap that is shared among all Java virtual machine threads. The heap is the runtime data area from which memory for all class instances and arrays is allocated. 
    The heap is created on virtual machine start-up. Heap storage for objects is reclaimed by an automatic storage management system (known as a garbage collector); objects are never explicitly de-allocated.
    The heap mainly store objects create using or class level variables.

    The following exceptional condition is associated with the heap: 
    • If a computation requires more heap than can be made available by the automatic storage management system, the Java virtual machine throws an OutOfMemoryError.

    What Is Stack?
    Each Java virtual machine thread has a private Java virtual machine stack, created at the same time as the thread. A Java virtual machine stack stores frames. It holds local variables and partial results, and plays a part in method invocation and return. Because the Java virtual machine stack is never manipulated directly except to push and pop frames, frames may be heap allocated. The memory for a Java virtual machine stack does not need to be contiguous.

    The Java virtual machine specification permits Java virtual machine stacks either to be of a fixed size or to dynamically expand and contract as required by the computation. 
    The following exceptional conditions are associated with Java virtual machine stacks:
    • If the computation in a thread requires a larger Java virtual machine stack than is permitted, the Java virtual machine throws a StackOverflowError. 
    • If Java virtual machine stacks can be dynamically expanded, and expansion is attempted but insufficient memory can be made available to effect the expansion, or if insufficient memory can be made available to create the initial Java virtual machine stack for a new thread, the Java virtual machine throws an OutOfMemoryError.


    Summary:
    ONLY Local variables (including method parameters) go on the STACK.
    Everything else goes on the HEAP. As variables don't store objects; they only hold primitives and references - so all objects go on the heap. And all class definitions go on the heap (in method area).
    String pool is also stored in Permanent generation (or Perm Area) of heap.
    ----------------------------------------------
    Also see..

    Saturday, 13 July 2013

    Two Minute Drills of SCJP - Kathy Sierra Part-1

    Identifiers
    •  Identifiers can begin with a letter, an underscore, or a currency character.
    •  After the first character, identifiers can also include digits.
    •  Identifiers can be of any length.
    •  JavaBeans methods must be named using camelCase, and depending on the method's purpose, must start with set, get, is, add, or remove
    Declaration Rules
    •  A source code file can have only one public class.
    •  If the source file contains a public class, the filename must match the public class name.
    •  A file can have only one package statement, but multiple imports.
    •  The package statement (if any) must be the first (non-comment) line in a source file.
    •  The import statements (if any) must come after the package and before the class declaration.
    •  If there is no package statement, import statements must be the first (noncomment) statements in the source file.
    •  package and import statements apply to all classes in the file.
    •  A file can have more than one nonpublic class.
    •  Files with no public classes have no naming restrictions.
    Class Access Modifiers
    •  There are three access modifiers: public, protected, and private.
    •  There are four access levels: public, protected, default, and private.
    •  Classes can have only public or default access.
    •  A class with default access can be seen only by classes within the same package.
    •  A class with public access can be seen by all classes from all packages.

    Class Modifiers
    •  Classes can also be modified with final, abstract, or strictfp.
    •  A class cannot be both final and abstract.
    •  A final class cannot be subclassed.
    •  An abstract class cannot be instantiated.
    •  A single abstract method in a class means the whole class must be abstract.
    •  An abstract class can have both abstract and nonabstract methods.
    •  The first concrete class to extend an abstract class must implement all of its bstract methods.

    Interface Implementation

    •  Interfaces are contracts for what a class can do, but they say nothing about
    • the way in which the class must do it.
    •  Interfaces can be implemented by any class, from any inheritance tree.
    •  An interface is like a 100-percent abstract class, and is implicitly abstract whether you type the abstract modifier in the declaration or not.
    • An interface can have only abstract methods, no concrete methods allowed.
    •  Interface methods are by default public and abstract—explicit declaration of these modifiers is optional.
    •  Interfaces can have constants, which are always implicitly public,static, and final.
    •  Interface constant declarations of public, static, and final are optional in any combination.
    •  A legal nonabstract implementing class has the following properties:
    •  It provides concrete implementations for the interface's methods.
    •  It must follow all legal override rules for the methods it implements.
    •  It must not declare any new checked exceptions for an implementation method.
    •  It must not declare any checked exceptions that are broader than the exceptions declared in the interface method.
    •  It may declare runtime exceptions on any interface method implementation regardless of the interface declaration.
    •  It must maintain the exact signature (allowing for covariant returns) and return type of the methods it implements (but does not have to declare the exceptions of the interface).
    •  A class implementing an interface can itself be abstract.
    •  An abstract implementing class does not have to implement the interface methods (but the first concrete subclass must).
    •  A class can extend only one class (no multiple inheritance), but it can implement many interfaces.
    •  Interfaces can extend one or more other interfaces.
    •  Interfaces cannot extend a class, or implement a class or interface.
    •  When taking the exam, verify that interface and class declarations are legal before verifying other code logic.
    • Member Access Modifiers
    •  Methods and instance (nonlocal) variables are known as "members."
    •  Members can use all four access levels: public, protected, default, private.
    •  Member access comes in two forms:
    •  Code in one class can access a member of another class.
    • A subclass can inherit a member of its superclass.
    •  If a class cannot be accessed, its members cannot be accessed.
    •  Determine class visibility before determining member visibility.
    •  public members can be accessed by all other classes, even in other packages.
    • If a superclass member is public, the subclass inherits it—regardless of package.
    •  Members accessed without the dot operator (.) must belong to the same class.
    • this. always refers to the currently executing object.
    •  this.aMethod() is the same as just invoking aMethod().
    •  private members can be accessed only by code in the same class.
    •  private members are not visible to subclasses, so private members cannot be inherited.
    •  Default and protected members differ only when subclasses are involved:
    •  Default members can be accessed only by classes in the same package.
    •  protected members can be accessed by other classes in the same package, plus subclasses regardless of package.
    •  protected = package plus kids (kids meaning subclasses).
    •  For subclasses outside the package, the protected member can be
    • accessed only through inheritance; a subclass outside the package cannot
    • access a protected member by using a reference to a superclass instance
    • (in other words, inheritance is the only mechanism for a subclass
    • outside the package to access a protected member of its superclass).
    •  A protected member inherited by a subclass from another package is not accessible to any other class in the subclass package, except for the subclass' own subclasses.

    Local Variables
    •  Local (method, automatic, or stack) variable declarations cannot have access modifiers.
    •  final is the only modifier available to local variables.
    •  Local variables don't get default values, so they must be initialized before use.
    • Other Modifiers—Members
    •  final methods cannot be overridden in a subclass.
    •  abstract methods are declared, with a signature, a return type, and an optional throws clause, but are not implemented.
    •  abstract methods end in a semicolon—no curly braces.
    •  Three ways to spot a non-abstract method:
    • The method is not marked abstract.
    •  The method has curly braces.
    • The method has code between the curly braces.
    •  The first nonabstract (concrete) class to extend an abstract class must implement all of the abstract class' abstract methods.
    •  The synchronized modifier applies only to methods and code blocks.
    •  synchronized methods can have any access control and can also be marked final.
    •  abstract methods must be implemented by a subclass, so they must be inheritable. For that reason:
    •  abstract methods cannot be private.
    •  abstract methods cannot be final.
    •  The native modifier applies only to methods.
    • The strictfp modifier applies only to classes and methods.
    • Methods with var-args
    •  As of Java 5, methods can declare a parameter that accepts from zero to many arguments, a so-called var-arg method.
    • A var-arg parameter is declared with the syntax type... name; for instance: doStuff(int... x) { }
    •  A var-arg method can have only one var-arg parameter.
    •  In methods with normal parameters and a var-arg, the var-arg must come last.

    Variable Declarations
     Instance variables can
    •  Have any access control
    •  Be marked final or transient
    •  Instance variables can't be abstract, synchronized, native, or strictfp.

    •  It is legal to declare a local variable with the same name as an instance variable; this is called "shadowing."
    •  final variables have the following properties:
    •  final variables cannot be reinitialized once assigned a value.
    •  final reference variables cannot refer to a different object once the object has been assigned to the final variable.
    • final reference variables must be initialized before the constructor completes.
    •  There is no such thing as a final object. An object reference marked final does not mean the object itself is immutable.
    •  The transient modifier applies only to instance variables.
    •  The volatile modifier applies only to instance variables.
    Array Declarations
    •  Arrays can hold primitives or objects, but the array itself is always an object.
    •  When you declare an array, the brackets can be to the left or right of the variable name.
    • It is never legal to include the size of an array in the declaration.
    •  An array of objects can hold any object that passes the IS-A (or instanceof) test for the declared type of the array. For example, if Horse extends Animal,then a Horse object can go into an Animal array.

    Static Variables and Methods
    •  They are not tied to any particular instance of a class.
    •  No classes instances are needed in order to use static members of the class.
    •  There is only one copy of a static variable / class and all instances share it.
    •  static methods do not have direct access to non-static members.

    Enums
    •  An enum specifies a list of constant values assigned to a type.
    •  An enum is NOT a String or an int; an enum constant's type is the enum type. For example, SUMMER and FALL are of the enum type Season.
    •  An enum can be declared outside or inside a class, but NOT in a method.
    •  An enum declared outside a class must NOT be marked static, final,abstract, protected, or private.
    • Enums can contain constructors, methods, variables, and constant class bodies.
    •  enum constants can send arguments to the enum constructor, using the syntax BIG(8), where the int literal 8 is passed to the enum constructor.
    •  enum constructors can have arguments, and can be overloaded.
    •  enum constructors can NEVER be invoked directly in code. They are always called automatically when an enum is initialized.
    •  The semicolon at the end of an enum declaration is optional. These are legal:
    • enum Foo { ONE, TWO, THREE}
    • enum Foo { ONE, TWO, THREE};

    •  MyEnum.values() returns an array of MyEnum's values.



    Hope you like this :)

    Diffrence Between Abstract Class and Interface

    Abstract class vs. Interface

    Abstract class can contain default implementation inside it. Interface cannot contain any implementation inside it. It only contains definitions.
    Interface mark the behavior between unrelated classes while abstract class impose you to derive the behavior.
    we can not make instance of abstract class as well interface.

    When Use Interface and Abstract Class

    use interface when something in design will change frequently.
    Abstract classes are provide some default behavior.abstract class are excellent candidates inside of application frameworks.
    Abstract class let you define some behavior,they forces their subclasses to provide others.
    Abstract class can contains abstract methods,abstract properties as well other like normal classes.
    Interface can contain only abstract methods and properties but we don’t want to put abstract or public method.it is by default.


    According to business logic of publish method having some default behavior then use abstract classes,if there is no default behavior and every drive has its own implementation then use interface.
    if i made content class as interface then its difficult to make a changes in base class because we need to implement changes in all drive classes like adding new method in content interface.
    CAN DO and IS-A also define difference between abstract class and interface.for example,if we have another interface “ICopy” which having behavior of copy and every drive class implemented it then we can say that “Article” class can do also copy.
    IS-A is for generalization or specialization, means class “Content” is generalized form of Article,Blogs,Review are a specialized form of content class.
    Abstract class is faster than interface because interface requires extra-in direction

    Sunday, 7 July 2013

    How to create Proxy object in java | creation of proxy object concept in spring AOP

    J2SE v1.3 has introduced a dynamic proxy class in the Java Reflection package.
    A dynamic proxy class implements a list of interfaces specified at runtime such that a method invocation through one of the interfaces on an instance of the class will be encoded and dispatched to another object through a uniform interface.
     Proxy classes and instances are created using static methods of the java.lang.reflect.Proxy class.Each proxy class has one public constructor that takes one argument, an implementation of the java.lang.reflect.InvocationHandler interface.


    package com.prox;

    public interface Showable {
       
    public void show();
    }





    -------------------------------------


    package com.prox;

    import java.lang.reflect.InvocationHandler;
    import java.lang.reflect.Method;

    public class MyHandler implements InvocationHandler{
       
        Showable target;
        public  MyHandler(Showable target)
        {
            this.target=target;
        }
        public Object invoke(Object proxy, Method m, Object [] args)throws Throwable
        {
            Object o= m.invoke(target, args);
            return o;
        }

    }


    ------------------------------------------

    package com.prox;

    public class A implements Showable{
       
        public void show()
        {
           
            System.out.println("Inside the Class A");
        }

    }


    ---------------------------------------------


    package com.prox;


    import java.lang.reflect.Proxy;

    public class ProxyTest {
       
        public static void main(String [] args)
        {
           
            System.out.println("Inside the main method");
            A  target = new  A();
            B  target1 = new  B();
            MyHandler handler= new MyHandler(target1);
            try {
             System.out.println("creating Proxy object");
             Showable pr=(Showable)Proxy.newProxyInstance(B.class.getClassLoader(),new
                    Class[]{Showable.class}, handler);
           
            System.out.println("The Invoking show method on proxy object");
            pr.show();
            System.out.println("the proxy object"+pr.getClass().getName());
            //B b=(B)pr;
            //b.notShow();
            }
           
            catch(Exception ex)
            {
                ex.printStackTrace();
            }
        }

    }


    -------------------------------------------

    In above code we have created a proxy object concept

    Drawback of proxy object

    • One limitation is that the method must be called through an instance of the proxy class. So nested methods calls, for instance, would not be intercepted.
    • Another limitation is that the method must have been defined in an Interface that is implemented by the object being proxied. It can not be called through an instance of a class that does not implement an interface.

    Tuesday, 2 July 2013

    5. Garbage Collection questions

    Q: Explain garbage collection? Or
    Q: How you can force the garbage collection? Or
    Q: What is the purpose of garbage collection in Java, and when is it used? Or
    Q: What is Garbage Collection and how to call it explicitly? Or
    Q: Explain Garbage collection mechanism in Java?
    Garbage collection is one of the most important features of Java. The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used. Garbage collection is also called automatic memory management as JVM automatically removes the unused variables/objects (value is null) from the memory. Every class inherits finalize() method from java.lang.Object, the finalize() method is called by garbage collector when it determines no more references to the object exists. In Java, it is good idea to explicitly assign null into a variable when no more in use. In Java on calling System.gc() and Runtime.gc(), JVM tries to recycle the unused objects, but there is no guarantee when all the objects will garbage collected. Garbage collection is an automatic process and can’t be forced. There is no guarantee that Garbage collection will start immediately upon request of System.gc().

    Q: What kind of thread is the Garbage collector thread?
    It is a daemon thread.
    Q: Can an object’s finalize() method be invoked while it is reachable?
    An object’s finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object’s finalize() method may be invoked by other objects.

    Q: Does garbage collection guarantee that a program will not run out of memory?
    Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.

    Q: What is the purpose of finalization?
    The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup, before the object gets garbage collected. For example, closing an opened database Connection.

    Q: If an object is garbage collected, can it become reachable again?
    Once an object is garbage collected, It can no longer become reachable again.

    4. Abstract Classes and Interfaces


    Q: What is the difference between Abstract class and Interface OrQ: When should you use an abstract class, when an interface, when both? OrQ: What is similarities/difference between an Abstract class and Interface? OrQ: What is the difference between interface and an abstract class?
    1. Abstract class is a class which contain one or more abstract methods, which has to be implemented by sub classes. An abstract class can contain no abstract methods also i.e. abstract class may contain concrete methods. A Java Interface can contain only method declarations and public static final constants and doesn’t contain their implementation. The classes which implement the Interface must provide the method definition for all the methods present.
    2. Abstract class definition begins with the keyword “abstract” keyword followed by Class definition. An Interface definition begins with the keyword “interface”.
    3. Abstract classes are useful in a situation when some general methods should be implemented and specialization behavior should be implemented by subclasses. Interfaces are useful in a situation when all its properties need to be implemented by subclasses
    4. All variables in an Interface are by default - public static final while an abstract class can have instance variables.
    5. An interface is also used in situations when a class needs to extend an other class apart from the abstract class. In such situations its not possible to have multiple inheritance of classes. An interface on the other hand can be used when it is required to implement one or more interfaces. Abstract class does not support Multiple Inheritance whereas an Interface supports multiple Inheritance.
    6. An Interface can only have public members whereas an abstract class can contain private as well as protected members.
    7. A class implementing an interface must implement all of the methods defined in the interface, while a class extending an abstract class need not implement any of the methods defined in the abstract class.
    8. The problem with an interface is, if you want to add a new feature (method) in its contract, then you MUST implement those method in all of the classes which implement that interface. However, in the case of an abstract class, the method can be simply implemented in the abstract class and the same can be called by its subclass
    9. Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast
    10.Interfaces are often used to describe the peripheral abilities of a class, and not its central identity, E.g. an Automobile class mightimplement the Recyclable interface, which could apply to many otherwise totally unrelated objects.
    Note: There is no difference between a fully abstract class (all methods declared as abstract and all fields are public static final) and an interface.
    Note: If the various objects are all of-a-kind, and share a common state and behavior, then tend towards a common base class. If all theyshare is a set of method signatures, then tend towards an interface.
    Similarities:Neither Abstract classes nor Interface can be instantiated.

    Q: What does it mean that a method or class is abstract?
    An abstract class cannot be instantiated. Only its subclasses can be instantiated. A class that has one or more abstract methods must be declared abstract. A subclass that does not provide an implementation for its inherited abstract methods must also be declared abstract. You indicate that a class is abstract with the abstract keyword like this:
    public abstract class AbstractClass
    Abstract classes may contain abstract methods. A method declared abstract is not actually implemented in the class. It exists only to be overridden in subclasses. Abstract methods may only be included in abstract classes. However, an abstract class is not required to have any abstract methods, though most of them do. Each subclass of an abstract class must override the abstract methods of its superclassesor itself be declared abstract. Only the method’s prototype is provided in the class definition. Also, a final method can not be abstract and vice versa. Methods specified in an interface are implicitly abstract.. It has no body. For example,
    public abstract float getInfo()

    Q: What must a class do to implement an interface?
    The class must provide all of the methods in the interface and identify the interface in its implements clause.

    Q: What is an abstract method?
    An abstract method is a method whose implementation is deferred to a subclass.

    Q: What is a marker interface & What is a cloneable interface and how many methods does it contain?
    Interfaces with empty bodies are called marker interfaces having certain property or behavior. Examples:java.lang.Cloneable,java.io.Serializable,java.util.EventListener.

    Q: What is interface? How to support multiple inhertance in Java?
    An Interface are implicitly abstract and public. An interface body can contain constant declarations, method prototype declarations, nested class declarations, and nested interface d Interfaces provide support for multiple inheritance in Java. A class that implements the interfaces is bound to implement all the methods defined in Interface.Example of Interface:public interface sampleInterface {public void functionOne();
    public long CONSTANT_ONE = 1000;}

    Q: What is an abstract class? OrQ: Can you make an instance of an abstract class?
    Abstract classes can contain abstract and concrete methods. Abstract classes cannot be instantiated directly i.e. we cannot call the constructor of an abstract class directly nor we can create an instance of an abstract class by using “Class.forName().newInstance()” (Here we get java.lang.InstantiationException). However, if we create an instance of a class that extends an Abstract class, compiler will initialize both the classes. Here compiler will implicitly call the constructor of the Abstract class. Any class that contain an abstract method must be declared “abstract” and abstract methods can have definitions only in child classes. By overriding and customizing the abstract methods in more than one subclass makes “Polymorphism” and through Inheritance we define body to the abstract methods. Basically an abstract class serves as a template. Abstract class must be extended/subclassed for it to be implemented. A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated. Abstract class is a class that provides some general functionality but leaves specific implementation to its inheriting classes.
    Example of Abstract class:
    abstract class AbstractClassExample{
    protected String name;public String getname() {return name;}public abstract void function();}
    Example: Vehicle is an abstract class and Bus Truck, car etc are specific implementations
    No! You cannot make an instance of an abstract class. An abstract class has to be sub-classed.If you have an abstract class and you want to use a method which has been implemented, you mayneed to subclass that abstract class, instantiate your subclass and then call that method.

    Q: What is meant by “Abstract Interface”?
    Firstly, an interface is abstract. That means you cannot have any implementation in an interface.All the methods declared in an interface are abstract methods or signatures of the methods.

    Q: How to define an Interface?
    In Java Interface defines the methods but does not implement them. Interface can include constants.A class that implements the interfaces is bound to implement all the methods defined in Interface.Example of Interface:
    public interface SampleInterface {public void functionOne();
    public long CONSTANT_ONE = 1000;}

    Q: Can Abstract Class have constructors? Can interfaces have constructors?
    Abstract class’s can have a constructor, but you cannot access it through the object, since you cannot instantiate abstract class. To access the constructor create a sub class and extend the abstract class which is having the constructor. Interfaces cannot have constructors.
    Examplepublic abstract class AbstractExample {public AbstractExample(){System.out.println(”In AbstractExample()”);}}
    public class Test extends AbstractExample{public static void main(String args[]){Test obj=new Test();}}

    Q: If interface & abstract class have same methods and those methods contain no implementation, which one would you prefer?
    Obviously one should ideally go for an interface, as we can only extend one class. Implementing an interface for a class is very much effective rather than extending an abstract class because we can extend some other useful class for this subclass

    3. Java Classes and Objects

    Q: What restrictions are placed on method overloading?
    Two methods may not have the same name and argument list but different return types.

    Q: What is the difference between String and StringBuffer?
    String objects are immutable whereas StringBuffer objects are not. StringBuffer unlike Strings support growable and modifiable strings.

    Q: Can a private method of a superclass be declared within a subclass?
    Sure. A private field or method or inner class belongs to its declared class and hides from its subclasses.There is no way for private stuff to have a runtime overloading or overriding (polymorphism) features.

    Q: What is the default value of an object reference declared as an instance variable?
    null unless we define it explicitly.

    Q: What is the difference between a constructor and a method? Or
    Q: How can a subclass call a method or a constructor defined in a superclass?
    A constructor is a member function of a class that is used to create objects of that class, invoked using the new operator. It has the same name as the class and has no return type. They are only called once, whereas member functions can be called many times. A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator. Constructor will be automatically invoked when an object is created whereas method has to be called explicitly.
    super.method(); is used to call a super class method from a sub class. To call a constructor of the super class, we use the super(); statement as the first line of the subclass’s constructor.

    Q: Can a top-level class be private or protected?
    No. A top-level class cannot be private or protected. It can have either “public” or no modifier. If it does not have a modifier it is supposed to have a default access. If a top level class is declared as private/protected the compiler will complain that the “modifier private is not allowed here”.

    Q: Why Java does not support multiple inheritance?
    Java does support multiple inheritance via interface implementation.

    Q: Where and how can you use a private constructor?
    Private constructor can be used if you do not want any other class to instantiate the class. This concept is generally used in Singleton Design Pattern. The instantiation of such classes is done from a static public method.

    Q: How are this() and super() used with constructors?
    this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.

    Q: What is Method Overriding? What restrictions are placed on method overriding?
    When a class defines a method using the same name, return type, and argument list as that of a method in its superclass, the method in the subclass is said to override the method present in the Superclass. When the method is invoked for an object of theclass, it is the new definition of the method that is called, and not the method definition from superclass.Restrictions placed on method overriding• Overridden methods must have the same name, argument list, and return type.• The overriding method may not limit the access of the method it overrides. Methods may be overridden to be more public, not more private.• The overriding method may not throw any exceptions that may not be thrown by the overridden method.

    Q: What are the Object and Class classes used for? Which class should you use to obtain design information about an object? or
    Q: Differentiate between a Class and an Object?
    The Object class is the highest-level class in the Java class hierarchy. The Class class is used to represent the classes and interfaces that are loaded by a Java program. The Class class is used to obtain information about an object’s design. A Class is only a definition or prototype of real life object. Whereas an object is an instance or living representation of real life object. Every object belongs to a class and every class contains one or more related objects.

    Q: What is a singleton class? Or
    Q: What is singleton pattern?

    This design pattern is used by an application to ensure that at any time there is only one instance of a class created. You can achieve this by having the private constructor in the class and having a getter method which returns an object of the class and creates one for the first time if its null.

    Q: What is method overloading and method overriding? Or
    Q: What is difference between overloading and overriding?

    Method overloading: When 2 or more methods in a class have the same method names with different arguments, it is said to be method overloading. Overloading does not block inheritance from the superclass. Overloaded methods must have different method signatures
    Method overriding : When a method in a class has the same method name with same arguments as that of the superclass,it is said to be method overriding. Overriding blocks inheritance from the superclass. Overridden methods must have same signature.
    Basically overloading and overriding are different aspects of polymorphism.
    static/early binding polymorphism: overloadingdynamic/late binding polymorphism: overriding
    Q: If a class is declared without any access modifiers, where may the class be accessed?
    A class that is declared without any access modifiers is said to have package or default access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.

    Q: Does a class inherit the constructors of its superclass?
    A class does not inherit constructors from any of its super classes.

    Q: Can an object’s finalize() method be invoked while it is reachable?
    An object’s finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object’s finalize() method may be invoked by other objects.

    Q: What is the purpose of the Runtime class?
    The purpose of the Runtime class is to provide access to the Java runtime system.
    It returns the runtime information like memory availability.
    * Runtime.freeMemory() –> Returns JVM Free Memory* Runtime.maxMemory() –> Returns the maximum amount of memory that the JVM will attempt to use. It also helps to run the garbage collector* Runtime.gc()

    Q: What is the purpose of the System class?
    The purpose of the System class is to provide access to system resources.

    Q: Can an unreachable object become reachable again?
    An unreachable object may become reachable again. This can happen when the object’s finalize() method is invoked and the object performs an operation which causes it to become accessible to reachable object.

    Q: What is a bean? Where can it be used?
    A Bean is a reusable and self-contained software component. Beans created using java take advantage of all the security and platform independent features of java. Bean can be plugged into any software application. Bean is a simple class which has set and get methods. It could be used within a JSP using JSP tags to use them.

    Q: What is the functionality of instanceOf() ?
    instanceOf opertaor is used to check whether an object can be cast to a specific type without throwing ClassCastException.

    Q: What would happen if you say this = null?
    It will come up with Error Message. “The left-hand side of an assignment must be a variable”.

    Q: I want to create two instances of a class ,But when trying for creating third instance it should not allow me to create . What i have to do for making this?
    One way of doing this would be:
    public class test1
    {
    static int cntr=0;
    test1()
    { cntr++;
    if(cntr>2)
    throw new NullPointerException();//u can define a new exception // for this
    }
    public static void main(String args[])
    {
    test1 t1= new test1();
    System.out.println(”hello 1″);
    test1 t2= new test1();
    System.out.println(”hello 2″);
    test1 t3= new test1();
    }
    }

    Q: What is the difference between an object and an instance?
    An Object May not have a class definition. eg int a[] where a is an array.
    An Instance should have a class definition.
    eg MyClass my=new MyClass();
    my is an instance.

    Q: What is heap in Java?
    It is a memory area which stores all the objects created by an executing program.

    Q: Why default constructor of base class will be called first in java?
    A subclass inherits all the methods and fields (eligible one) from the base class, so base class is constructed in the process of creation of subclass object (subclass is also an object of superclass). Hence before initializing the default value of sub class the super class should be initialized using the default constructor.

    Q: What are the other ways to create an object other than creating as new object?
    We can create object in different ways;
    1.new operator
    2.class.forName: Classname obj = Class.forName(”Fully Qualified class Name”).newInstance();
    3.newInstance
    4.object.clone

    Q: What is the difference between instance, object, reference and a class?
    Class: A class is a user defined data type with set of data members & member functions
    Object: An Object is an instance of a class
    Reference: A reference is just like a pointer pointing to an object
    Instance: This represents the values of data members of a class at a particular time

    2. Java packages interview questions

    Q: Do I need to import java.lang package any time? Why? Or
    Which package is always imported by default?

    No. It is by default loaded internally by the JVM. The java.lang package is always imported by default.

    Q: Can I import same package/class twice? Will the JVM load the package twice at runtime?
    One can import the same package or same class multiple times. Neither compiler nor JVM complains anything about it. And the JVM will internally load the class only once no matter how many times you import the same class.

    Q: Does importing a package imports the sub packages as well? E.g. Does importing com.bob.* also import com.bob.code.*?
    No you will have to import the sub packages explicitly. Importing com.bob.* will import classes in the package bob only. It will not import any class in any of its sub package’s.

    Q: What is a Java package and how is it used? Or
    Q: Explain the usage of Java packages.

    A Java package is a naming context for classes and interfaces. A package is used to create a separate name space for groups of classes and interfaces. Packages are also used to organize related classes and interfaces into a single API unit and to control accessibility to these classes and interfaces.For example: The Java API is grouped into libraries of related classes and interfaces; these libraries are known as package.

    Q: Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.BOB compile?
    Yes the imports are checked for the semantic validity at compile time. The code containing above line of import will not compile. It will throw an error saying, cannot resolve symbol.
    If you think that an important java interview question is missing or some answers are wrong in the site

    1. Glossary of Terms:

    A
    abstract
    A Java(TM) programming language keyword used in a class definition to specify that a class is not to be instantiated, but rather inherited by other classes. An abstract class can have abstract methods that are not implemented in the abstract class, but in subclasses.
    abstract class
    A class that contains one or more abstract methods, and therefore can never be instantiated. Abstract classes are defined so that other classes can extend them and make them concrete by implementing the abstract methods.
    abstract method
    A method that has no implementation.
    actual parameter list
    The arguments specified in a particular method call. See also formal parameter list.
    API
    Application Programming Interface. The specification of how a programmer writing an application accesses the behavior and state of classes and objects.
    applet
    A program written in the Java(TM) programming language to run within a web browser compatible with the Java platform, such as HotJava(TM) or Netscape Navigator(TM).
    argument
    A data item specified in a method call. An argument can be a literal value, a variable, or an expression.
    array
    A collection of data items, all of the same type, in which each item's position is uniquely designated by an integer.
    ASCII
    American Standard Code for Information Interchange. A standard assignment of 7-bit numeric codes to characters. See also Unicode.
    atomic
    Refers to an operation that is never interrupted or left in an incomplete state under any circumstance.

    B
    Bean
    A reusable software component. Beans can be combined to create an application.
    binary operator
    An operator that has two arguments.
    bit
    The smallest unit of information in a computer, with a value of either 0 or 1.
    bitwise operator
    An operator that manipulates two values comparing each bit of one value to the corresponding bit of the other value.
    block
    In the Java(TM) programming language, any code between matching braces. Example: { x = 1; }.
    boolean
    Refers to an expression or variable that can have only a true or false value. The Java(TM) programming language provides the boolean type and the literal values true and false.
    .
    break
    A Java(TM) programming language keyword used to resume program execution at the statement immediately following the current statement. If followed by a label, the program resumes execution at the labeled statement.
    byte
    A sequence of eight bits. The Java(TM) programming language provides a corresponding byte type.
    bytecode
    Machine-independent code generated by the Java(TM) compiler and executed by the Java interpreter.

    C
    case
    A Java(TM) programming language keyword that defines a group of statements to begin executing if a value specified matches the value defined by a preceding "switch" keyword.
    casting
    Explicit conversion from one data type to another.
    catch
    A Java(TM) programming language keyword used to declare a block of statements to be executed in the event that a Java exception, or run time error, occurs in a preceding "try" block.
    char
    A Java(TM) programming language keyword used to declare a variable of type character.
    class
    In the Java(TM) programming language, a type that defines the implementation of a particular kind of object. A class definition defines instance and class variables and methods, as well as specifying the interfaces the class implements and the immediate superclass of the class. If the superclass is not explicitly specified, the superclass will implicitly be Object.
    class method
    A method that is invoked without reference to a particular object. Class methods affect the class as a whole, not a particular instance of the class. Also called a static method. See also instance method.
    classpath
    A classpath is an environmental variable which tells the Java(TM) virtual machine* and Java technology-based applications (for example, the tools located in the JDK(TM) 1.1.X\bin directory) where to find the class libraries, including user-defined class libraries.
    class variable
    A data item associated with a particular class as a whole--not with particular instances of the class. Class variables are defined in class definitions. Also called a static field. See also instance variable.
    client
    In the client/server model of communcations, the client is a process that remotely accesses resources of a compute server, such as compute power and large memory capacity.
    comment
    In a program, explanatory text that is ignored by the compiler. In programs written in the Java(TM) programming language, comments are delimited using // or /*...*/.
    compilation unit
    The smallest unit of source code that can be compiled. In the current implementation of the Java(TM) platform, the compilation unit is a file.
    compiler
    A program to translate source code into code to be executed by a computer. The Java(TM) compiler translates source code written in the Java programming language into bytecode for the Java virtual machine*. See also interpreter.
    compositing
    The process of superimposing one image on another to create a single image.
    constructor
    A pseudo-method that creates an object. In the Java(TM) programming language, constructors are instance methods with the same name as their class. Constructors are invoked using the new keyword.
    const
    This is a reserved Java(TM) programming language keyword. However, it is not used by current versions of the Java programming language.
    continue
    A Java(TM) programming language keyword used to resume program execution at the end of the current loop. If followed by a label, "continue" resumes execution where the label occurs.
    core class
    A public class (or interface) that is a standard member of the Java(TM) Platform. The intent is that the core classes for the Java platform, at minimum, are available on all operating systems where the Java platform runs. A program written entirely in the Java programming language relies only on core classes, meaning it can run anywhere. See also, 100% Pure Java(TM).
    Core Packages
    The required set of APIs in a Java platform edition which must be supported in any and all compatible implementations.

    D
    declaration
    A statement that establishes an identifier and associates attributes with it, without necessarily reserving its storage (for data) or providing the implementation (for methods). See also definition.
    default
    A Java(TM) programming language keyword optionally used after all "case" conditions in a "switch" statement. If all "case" conditions are not matched by the value of the "switch" variable, the "default" keyword will be executed.
    definition
    A declaration that reserves storage (for data) or provides implementation (for methods). See also declaration.
    deprecation
    Refers to a class, interface, constructor, method or field that is no longer recommended, and may cease to exist in a future version.
    derived from
    Class X is "derived from" class Y if class X extends class Y. See also subclass, superclass.
    distributed
    Running in more than one address space.
    do
    A Java(TM) programming language keyword used to declare a loop that will iterate a block of statements. The loop`s exit condition can be specified with the "while" keyword.
    double
    A Java(TM) programming language keyword used to define a variable of type double.
    double precision
    In the Java(TM) programming language specification, describes a floating point number that holds 64 bits of data. See also single precision.

    E
    else
    A Java(TM) programming language keyword used to execute a block of statements in the case that the test condition with the "if" keyword evaluates to false.
    EmbeddedJava(TM) Technology
    The availability of Sun's Java 2 Platform, Micro Edition technology under a restrictive license agreement that allows a licensee to leverage certain Java technologies to create and deploy a closed-box application that exposes no APIs.
    encapsulation
    The localization of knowledge within a module. Because objects encapsulate data and implementation, the user of an object can view the object as a black box that provides services. Instance variables and methods can be added, deleted, or changed, but as long as the services provided by the object remain the same, code that uses the object can continue to use it without being rewritten. See also instance variable, instance method.
    exception
    An event during program execution that prevents the program from continuing normally; generally, an error. The Java(TM) programming language supports exceptions with the try, catch, and throw keywords. See also exception handler.
    exception handler
    A block of code that reacts to a specific type of exception. If the exception is for an error that the program can recover from, the program can resume executing after the exception handler has executed.
    executable content
    An application that runs from within an HTML file. See also applet.
    extends
    Class X extends class Y to add functionality, either by adding fields or methods to class Y, or by overriding methods of class Y. An interface extends another interface by adding methods. Class X is said to be a subclass of class Y. See also derived from.

    F
    field
    A data member of a class. Unless specified otherwise, a field is not static.
    final
    A Java(TM) programming language keyword. You define an entity once and cannot change it or derive from it later. More specifically: a final class cannot be subclassed, a final method cannot be overridden and a final variable cannot change from its initialized value.
    finally
    A Java(TM) programming language keyword that executes a block of statements regardless of whether a Java Exception, or run time error, occurred in a block defined previously by the "try" keyword.
    float
    A Java(TM) programming language keyword used to define a floating point number variable.
    for
    A Java(TM) programming language keyword used to declare a loop that reiterates statements. The programmer can specify the statements to be executed, exit conditions, and initialization variables for the loop.
    FTP
    The basic Internet File Transfer Protocol. FTP, which is based on TCP/IP, enables the fetching and storing of files between hosts on the Internet. See also TCP/IP.
    formal parameter list
    The parameters specified in the definition of a particular method. See also actual parameter list.

    G
    garbage collection
    The automatic detection and freeing of memory that is no longer in use. The Java(TM) runtime system performs garbage collection so that programmers never explicitly free objects.
    goto
    This is a reserved Java(TM) programming language keyword. However, it is not used by current versions of the Java programming language.

    H
    hexadecimal
    The numbering system that uses 16 as its base. The marks 0-9 and a-f (or equivalently A-F) represent the digits 0 through 15. In programs written in the Java(TM) programming language, hexadecimal numbers must be preceded with 0x. See also octal.
    hierarchy
    A classification of relationships in which each item except the top one (known as the root) is a specialized form of the item above it. Each item can have one or more items below it in the hierarchy. In the Java(TM) class hierarchy, the root is the Object class.
    HotJava(TM) Browser
    An easily customizable Web browser developed by Sun Microsystems, which is written in the Java(TM) programming language.
    HTML
    HyperText Markup Language. This is a file format, based on SGML, for hypertext documents on the Internet. It is very simple and allows for the embedding of images, sounds, video streams, form fields and simple text formatting. References to other objects are embedded using URLs.
    HTTP
    HyperText Transfer Protocol. The Internet protocol, based on TCP/IP, used to fetch hypertext objects from remote hosts. See also TCP/IP.

    I
    IDL
    Interface Definition Language. APIs written in the Java(TM) programming language that provide standards-based interoperability and connectivity with CORBA (Common Object Request Broker Architecture).
    identifier
    The name of an item in a program written in the Java(TM) programming language.
    if
    A Java(TM) programming language keyword used to conduct a conditional test and execute a block of statements if the test evaluates to true.
    implements
    A Java(TM) programming language keyword optionally included in the class declaration to specify any interfaces that are implemented by the current class.
    import
    A Java(TM) programming language keyword used at the beginning of a source file that can specify classes or entire packages to be referred to later without including their package names in the reference.
    inheritance
    The concept of classes automatically containing the variables and methods defined in their supertypes. See also superclass, subclass.
    instance
    An object of a particular class. In programs written in the Java(TM) programming language, an instance of a class is created using the new operator followed by the class name.
    instance method
    Any method that is invoked with respect to an instance of a class. Also called simply a method. See also class method.
    instance variable
    Any item of data that is associated with a particular object. Each instance of a class has its own copy of the instance variables defined in the class. Also called a field. See also class variable.
    instanceof
    A two-argument Java(TM) programming language keyword that tests whether the run-time type of its first argument is assignment compatible with its second argument.
    int
    A Java(TM) programming language keyword used to define a variable of type integer.
    interface
    A Java(TM) programming language keyword used to define a collection of method definitions and constant values. It can later be implemented by classes that define this interface with the "implements" keyword.
    Internet
    An enormous network consisting of literally millions of hosts from many organizations and countries around the world. It is physically put together from many smaller networks and data travels by a common set of protocols.
    IP
    Internet Protocol. The basic protocol of the Internet. It enables the unreliable delivery of individual packets from one host to another. It makes no guarantees about whether or not the packet will be delivered, how long it will take, or if multiple packets will arrive in the order they were sent. Protocols built on top of this add the notions of connection and reliability. See also TCP/IP.
    interpreter
    A module that alternately decodes and executes every statement in some body of code. The Java(TM) interpreter decodes and executes bytecode for the Java virtual machine*. See also compiler, runtime system.

    J
    JAE
    Java(TM) Application Environment. The source code release of the Java Development Kit (JDK(TM)) software.
    JAR Files (.jar)
    Java ARchive. A file format used for aggregating many files into one.
    JAR file format
    JAR (Java Archive) is a platform-independent file format that aggregates many files into one. Multiple applets written in the Java(TM) programming language, and their requisite components (.class files, images, sounds and other resource files) can be bundled in a JAR file and subsequently downloaded to a browser in a single HTTP transaction. It also supports file compression and digital signatures.
    Java(TM)
    Sun's trademark for a set of technologies for creating and safely running software programs in both stand-alone and networked environments.
    Java Application Environment (JAE)
    The source code release of the Java Development Kit (JDK(TM)) software.
    JavaBeans(TM)
    A portable, platform-independent reusable component model.
    Java Blend(TM)
    A product that enables developers to simplify database application development by mapping database records to objects in the Java(TM) programming language (Java objects) and Java objects to databases.
    Java Card(TM) API
    An ISO 7816-4 compliant application environment focused on smart cards.
    JavaCheck(TM)
    A tool for checking compliance of applications and applets to a specification.
    JavaChip(TM)
    Sun's processor, which executes bytecode for the Java(TM) virtual machine* natively. With a JavaChip processor, bytecode bypasses the virtual machine or just-in-time compiler stage to go directly to the processor.
    Java(TM) Compatibility Kit (JCK)
    A test suite, a set of tools, and other requirements used to certify a Java platform implementation conformant both to the applicable Java platform specifications and to Java Software reference implementations.
    Java Database Connectivity (JDBC(TM))
    An industry standard for database-independent connectivity between the Java(TM) platform and a wide range of databases. The JDBC(TM) provides a call-level API for SQL-based database access.
    Java Developer Connection(SM)
    A service designed for individual developers, providing online training, product discounts, feature articles, bug information, and early access capabilities.
    Java Development Kit (JDK(TM))
    A software development environment for writing applets and applications in the Java programming language.
    Java(TM) Electronic Commerce Framework
    A structured architecture for the development of electronic commerce applications in the Java(TM) programming language.
    Java(TM) Enterprise API
    This API makes it easy to create large-scale commercial and database applications that can share multimedia data with other applications within an organization or across the Internet. Four APIs have been designed within the Java(TM) Enterprise API family.
    Java(TM) Foundation Classes (JFC)
    An extension that adds graphical user interface class libraries to the Abstract Windowing Toolkit (AWT).
    Java(TM) Interface Definition Language (IDL)
    APIs written in the Java programming language that provide standards-based interoperability and connectivity with CORBA (Common Object Request Broker Architecture).
    Java(TM) Media APIs
    A set of APIs that support the integration of audio and video clips, 2D fonts, graphics, and images as well as 3D models and telephony.
    Java(TM) Media Framework
    The core framework supports clocks for synchronizing between different media (e.g., audio and video output). The standard extension framework allows users to do full audio and video streaming.
    Java Naming and Directory Interface(TM) (JNDI)
    A set of APIs that assists with the interfacing to multiple naming and directory services.
    JavaOS(TM)
    An Java(TM) technology-based operating system that is optimized to run on a variety of computing and consumer platforms. The JavaOS(TM) operating environment provides a runtime specifically tuned to run applications written in the Java programming language directly on hardware platforms without requiring a host operating system.
    JavaPlan(TM)
    An object-oriented design and diagramming tool written in the Java(TM) programming language.
    Java(TM) Platform
    Consists of a language for writing programs ("the Java(TM) programming language"); a set of APIs, class libraries, and other programs used in developing, compiling, and error-checking programs; and a virtual machine which loads and executes the class files. In addition, the Java platform is subject to a set of compatibility requirements to ensure consistent and compatible implementations. Implementations that meet the compatibility requirements may qualify for Sun's targeted compatibility brands. The Java(TM) 2 platform is the current generation of the Java platform.
    Java(TM) Platform Editions
    A Java platform "edition" is a definitive and agreed-upon version of the Java platform that provides the functionality needed over a broad market segment. An edition is comprised of two kinds of API sets: (i) "core packages," which are essential to all implementations of a given platform edition, and (ii) "optional packages," which are available for a given platform edition and which may be supported in a compatible implementation. There are 3 distinct editions of the Java Platform: * Java 2 Platform, Enterprise Edition:The edition of the Java platform that is targeted at enterprises to enable development, deployment, and management of multi-tier server-centric applications. * Java 2 Platform, Standard Edition:The edition of the Java platform that enables development, deployment, and management of cross-platform, general-purpose applications. * Java 2 Platform, Micro Edition:The edition of the Java platform that is targeted at small, standalone or connectable consumer and embedded devices to enable development, deployment, and management of applications that can scale from smart cards through mobile devices and set-top boxes to conventional computing devices.
    Java(TM) Remote Method Invocation (RMI)
    A distributed object model for Java(TM) program to Java program, in which the methods of remote objects written in the Java programming language can be invoked from other Java virtual machines*, possibly on different hosts.
    Java(TM) Runtime Environment (JRE)
    A subset of the Java Development Kit (JDK(TM)) for end-users and developers who want to redistribute the runtime environment alone. The Java runtime environment consists of the Java virtual machine*, the Java core classes, and supporting files.
    JavaSafe(TM)
    A tool for tracking and managing source file changes, written in the Java(TM) programming language.
    JavaScript(TM)
    A Web scripting language that is used in both browsers and Web servers. Like all scripting languages, it is used primarily to tie other components together or to accept user input.
    Java Studio(TM)
    The first program that allows you to easily create Java(TM) technology-based applications and applets without having to know the Java programming language.
    Java(TM) Technologies
    A set of technologies that enable the creation and safe running of software programs in both stand-alone and networked environments.
    Java(TM) virtual machine (JVM)*
    Sun's specification for or implementation of a software "execution engine" that safely and compatibly executes the byte codes in Java class files on a microprocessor (whether in a computer or in another electronic device). * Java HotSpot(TM) performance engine - Sun's ultra-high-performance engine for implementing the Java runtime environment which features an adaptive compiler that dynamically optimizes the performance of running applications. * KJava(TM) virtual machine - Sun's small-footprint, highly optimized foundation of a runtime environment within the Java 2 Platform, Micro Edition. Derived from the Java virtual machine, it is targeted at small connected devices and can scale from 30KB to approximately 128KB, depending on the target device's functionality. * Java Card(TM) virtual machine - Sun's ultra-small-footprint, highly-optimized foundation of a runtime environment within the Java 2 Platform, Micro Edition. Derived from the Java virtual machine, it is targeted at smart cards and other severely memory-constrained devices and can run in devices with memory as small as 24K of ROM, 16K of EEPROM, and 512 bytes of RAM.
    Java Web Server(TM)
    The easy-to-use, extensible, easy-to-administer, secure, platform-independent solution to speed and simplify the deployment and management of your Internet and Intranet Web sites. It provides immediate productivity for robust, full-featured, Java technology-based server applications.
    Java Workshop(TM)
    A complete set of tools integrated into a single environment for managing programming with Java technology. The Java Workshop software uses a highly modular structure that enables you to easily plug new tools into the overall structure.
    Java(TM) wallet
    A user interface, built on the Java(TM) Electronic Commerce Framework, which allows for online purchases, value transfers, and administrative functions.
    JavaSpaces(TM)
    A technology that provides distributed persistence and data exchange mechanisms for code in the Java(TM) programming language.
    JavaSoft(TM)
    A former business unit of Sun Microsystems, Inc., currently known as Sun Microsystems, Inc., Java Software division.
    JDBC(TM)
    Java(TM) Database Connectivity. An industry standard for database-independent connectivity between the Java platform and a wide range of databases. The JDBC interface provides a call-level API for SQL-based database access.
    JDK(TM)
    Java(TM) Development Kit software. A software development environment for writing applets and application in the Java programming language.
    JFC
    Java(TM) Foundation Class. An extension that adds graphical user interface class libraries to the Abstract Windowing Toolkit (AWT).
    Jini(TM) Technology
    Sun's Jini technology includes a set of APIs that may be incorporated an optional package for any Java 2 platform edition. This set of APIs enables transparent networking of devices and services and eliminates the need for system or network administration intervention by a user. The Jini technology is currently an optional package available on all Java 2 platform editions.
    JMAPI
    Java(TM) Management API. A collection of Java programming language classes and interfaces that allow developers to build system, network, and service management applications.
    JNDI
    Java Naming and Directory Interface(TM). A set of APIs that assist with the interfacing to multiple naming and directory services.
    JPEG
    Joint Photographic Experts Group. An image file compression standard established by this group. It achieves tremendous compression at the cost of introducing distortions into the image which are almost always imperceptible.
    JRE
    Java(TM) runtime environment. A subset of the Java Developer Kit for end-users and developers who want to redistribute the runtime environment. The Java runtime environment consists of the Java virtual machine*, the Java core classes, and supporting files.
    Just-in-time (JIT) Compiler
    A compiler that converts all of the bytecode into native machine code just as a Java(TM) program is run. This results in run-time speed improvements over code that is interpreted by a Java virtual machine*.
    JVM
    Java(TM) Virtual Machine*. The part of the Java Runtime Environment responsible for interpreting bytecodes.

    K
    keyword
    The Java(TM) programming language sets aside words as keywords - these words are reserved by the language itself and therefore are not available as names for variables or methods.

    L
    linker
    A module that builds an executable, complete program from component machine code modules. The Java(TM) linker creates a runnable program from compiled classes. See also compiler, interpreter, runtime system.
    literal
    The basic representation of any integer, floating point, or character value. For example, 3.0 is a double-precision floating point literal, and "a" is a character literal.
    local variable
    A data item known within a block, but inaccessible to code outside the block. For example, any variable defined within a method is a local variable and can't be used outside the method.
    long
    A Java(TM) programming language keyword used to define a variable of type long.
    M
    member
    A field or method of a class. Unless specified otherwise, a member is not static.
    method
    A function defined in a class. See also instance method, class method. Unless specified otherwise, a method is not static.
    Mosaic
    A program that provides a simple GUI that enables easy access to the data stored on the Internet. These data may be simple files or hypertext documents. Mosaic was written by a team at NCSA.
    multithreaded
    Describes a program that is designed to have parts of its code execute concurrently. See also thread.

    N
    native
    A Java(TM) programming language keyword that is used in method declarations to specify that the method is not implemented in the same Java source file, but rather in another language
    new
    A Java(TM) programming language keyword used to create an instance of a class.
    null
    A Java(TM) programming language keyword used to specify an undefined value for reference variables.

    O
    object
    The principal building blocks of object-oriented programs. Each object is a programming unit consisting of data (instance variables) and functionality (instance methods). See also class.
    object-oriented design
    A software design method that models the characteristics of abstract or real objects using classes and objects.
    octal
    The numbering system using 8 as its base, using the numerals 0-7 as its digits. In programs written in the Java(TM) programming language, octal numbers must be preceded with 0. See also hexadecimal.
    Optional Packages
    The set or sets of APIs in a Java platform edition which are available with and may be supported in a compatible implementation. Over time, optional packages may become required in an edition as the marketplace requires them.
    overloading
    Using one identifier to refer to multiple items in the same scope. In the Java(TM) programming language, you can overload methods but not variables or operators.
    overriding
    Providing a different implementation of a method in a subclass of the class that originally defined the method.

    P
    package
    A group of types. Packages are declared with the package keyword.
    peer
    In networking, any functional unit in the same layer as another entity.
    PersonalJava(TM)
    A Java runtime environment for network-connectable applications on personal consumer devices for home, office, and mobile use.
    pixel
    The smallest addressable picture element on a display screen or printed page.
    POSIX
    Portable Operating System for UNIX(TM). A standard that defines the language interface between the UNIX operating system and application programs through a minimal set of supported functions.
    private
    A Java(TM) programming language keyword used in a method or variable declaration. It signifies that the method or variable can only be accessed by other elements of its class.
    process
    A virtual address space containing one or more threads.
    property
    Characteristics of an object that users can set, such as the color of a window.
    Profiles
    A Profile is a collection of Java APIs that complements one or more Java 2 Platform Editions by adding domain-specific capabilities. Profiles may also include other defined Profiles. A profile implementation requires a Java 2 Platform Edition to create a complete development and deployment environment in a targeted vertical market. Each profile is subject to an associated set of compatibility requirements. Profiles may be usable on one or more editions. Some examples of profiles within the Java 2 Platform, Micro Edition are:* PersonalJava(TM) - for non-PC products that need to display web-compatible Java-based content* Java Card(TM) - for secure smart cards and other severely memory-constrained devices.
    protected
    A Java(TM) programming language keyword used in a method or variable declaration. It signifies that the method or variable can only be accessed by elements residing in its class, subclasses, or classes in the same package.
    public
    A Java(TM) programming language keyword used in a method or variable declaration. It signifies that the method or variable can be accessed by elements residing in other classes.

    R
    reference
    A data element whose value is an address.
    return
    A Java(TM) programming language keyword used to finish the execution of a method. It can be followed by a value required by the method definition.
    .
    RMI
    See Java Remote Method Invocation.
    root
    In a hierarchy of items, the one item from which all other items are descended. The root item has nothing above it in the hierarchy. See also hierarchy, class, package.
    RPC
    Remote Procedure Call. Executing what looks like a normal procedure call (or method invocation) by sending network packets to some remote host.
    runtime system
    The software environment in which programs compiled for the Java(TM) virtual machine* can run. The runtime system includes all the code necessary to load programs written in the Java programming language, dynamically link native methods, manage memory, handle exceptions, and an implementation of the Java virtual machine, which may be a Java interpreter.

    S
    Sandbox
    Comprises a number of cooperating system components, ranging from security managers that execute as part of the application, to security measures designed into the Java(TM) virtual machine* and the language itself. The sandbox ensures that an untrusted, and possibly malicious, application cannot gain access to system resources.
    scope
    A characteristic of an identifier that determines where the identifier can be used. Most identifiers in the Java(TM) programming environment have either class or local scope. Instance and class variables and methods have class scope; they can be used outside the class and its subclasses only by prefixing them with an instance of the class or (for class variables and methods) with the class name. All other variables are declared within methods and have local scope; they can be used only within the enclosing block.
    Secure Socket Layer (SSL)
    A protocol that allows communication between a Web browser and a server to be encrypted for privacy.
    servlet
    A server-side program that gives Java(TM) technology-enabled servers additional functionality.
    short
    A Java(TM) programming language keyword used to define a variable of type short.
    single precision
    In the Java(TM) language specification, describes a floating point number with 32 bits of data. See also double precision.
    .
    static
    A Java(TM) programming language keyword used to define a variable as a class variable. Classes maintain one copy of class variables regardless of how many instances exist of that class. "static" can also be used to define a method as a class method. Class methods are invoked by the class instead of a specific instance, and can only operate on class variables.
    static field
    Another name for class variable.
    static method
    Another name for class method.
    subarray
    An array that is inside another array.
    subclass
    A class that is derived from a particular class, perhaps with one or more classes in between. See also superclass, supertype.
    subtype
    If type X extends or implements type Y, then X is a subtype of Y. See also supertype.
    superclass
    A class from which a particular class is derived, perhaps with one or more classes in between. See also subclass, subtype.
    super
    A Java(TM) programming language keyword used to access members of a class inherited by the class in which it appears.
    supertype
    The supertypes of a type are all the interfaces and classes that are extended or implemented by that type. See also subtype, superclass.
    switch
    A Java(TM) programming language keyword used to evaluate a variable that can later be matched with a value specified by the "case" keyword in order to execute a group of statements.
    Swing Set
    The code name for a collection of graphical user interface (GUI) components that runs uniformly on any native platform which supports the Java(TM) virtual machine*. Because they are written entirely in the Java programming language, these components may provide functionality above and beyond that provided by native-platform equivalents. (Contrast with AWT.)
    synchronized
    A keyword in the Java programming language that, when applied to a method or code block, guarantees that at most one thread at a time executes that code.

    T
    TCP/IP
    Transmission Control Protocol based on IP. This is an Internet protocol that provides for the reliable delivery of streams of data from one host to another. See also IP.
    Thin Client
    A system that runs a very light operating system with no local system administration and executes applications delivered over the network.
    this
    A Java(TM) programming language keyword that can be used to represent an instance of the class in which it appears. "this" can be used to access class variables and methods.
    thread
    The basic unit of program execution. A process can have several threads running concurrently, each performing a different job, such as waiting for events or performing a time-consuming job that the program doesn't need to complete before going on. When a thread has finished its job, the thread is suspended or destroyed. See also process.
    throw
    A Java(TM) programming language keyword that allows the user to throw an exception or any class that implements the "throwable" interface.
    throws
    A Java(TM) programming language keyword used in method declarations that specify which exceptions are not handled within the method but rather passed to the next higher level of the program.
    transient
    A keyword in the Java programming language that indicates that a field is not part of the serialized form of an object. When an object is serialized, the values of its transient fields are not included in the serial representation, while the values of its non-transient fields are included.
    try
    A Java(TM) programming language keyword that defines a block of statements that may throw a Java language exception. If an exception is thrown, an optional "catch" block can handle specific exceptions thrown within the "try" block. Also, an optional "finally" block will be executed regardless of whether an exception is thrown or not.
    type
    A class or interface.

    U
    Unicode
    A 16-bit character set defined by ISO 10646. See also ASCII. All source code in the Java(TM) programming environment is written in Unicode.
    URL
    Uniform Resource Locator. A standard for writing a text reference to an arbitrary piece of data in the WWW. A URL looks like "protocol://host/localinfo" where protocol specifies a protocol to use to fetch the object (like HTTP or FTP), host specifies the Internet name of the host on which to find it, and localinfo is a string (often a file name) passed to the protocol handler on the remote host.
    variable
    An item of data named by an identifier. Each variable has a type, such as int or Object, and a scope. See also class variable, instance variable, local variable.
    virtual machine
    An abstract specification for a computing device that can be implemented in different ways, in software or hardware. You compile to the instruction set of a virtual machine much like you'd compile to the instruction set of a microprocessor. The Java(TM) virtual machine* consists of a bytecode instruction set, a set of registers, a stack, a garbage-collected heap, and an area for storing methods.
    void
    A Java(TM) programming language keyword used in method declarations to specify that the method does not return any value. "void" can also be used as a nonfunctional statement.
    volatile
    A Java(TM) programming language keyword used in variable declarations that specifies that the variable is modified asynchronously by concurrently running threads.

    W
    wait
    A UNIX® command which will wait for all background processes to complete, and report their termination status.
    while
    A Java(TM) programming language keyword used to declare a loop that iterates a block of statements. The loop`s exit condition is specified as part of the while statement.
    world readable files
    Files on a file system that can be viewed (read) by any user. For example: files residing on web servers can only be viewed by Internet users if their permissions have been set to world readable.
    wrapper
    An object that encapsulates and delegates to another object to alter its interface or behavior in some way.

    LinkWithin

    Related Posts Plugin for WordPress, Blogger...