public static void shuff(int[] arr) {
for(int i=0; i
int rand = (int)(Math.random() * arr.length);
int temp = arr[rand];
arr[rand] = arr[i];
arr[i] = temp;
}
for(int i=0; i
System.out.println(" "+arr[i]);
}
}
}
Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.
This implementation iterates over this collection, checking each
element returned by the iterator in turn to see if it's contained
in the specified collection. If it's not so contained, it's removed
from this collection with the iterator's remove method.
Note that this implementation will throw an
UnsupportedOperationException if the iterator returned by the
iterator method does not implement the remove method
and this collection contains one or more elements not present in the
specified collection.
If a security manager is present, and the caller's class loader is
not null and the caller's class loader is not the same as or an ancestor of
the class loader for the class whose class loader is requested, then
this method calls the security manager's checkPermission
method with a RuntimePermission("getClassLoader")
permission to ensure it's ok to access the class loader for the class.
If this object
represents a primitive type or void, null is returned.
@return the class loader that loaded the class or interface
represented by this object.
@throws SecurityException
if a security manager exists and its
checkPermission
method denies
access to the class loader for the class.
@see java.lang.ClassLoader
@see SecurityManager#checkPermission
@see java.lang.RuntimePermission
Every {@link Class Class} object contains a {@link
* Class#getClassLoader() reference} to the ClassLoader that defined
* it.
*
*
Class objects for array classes are not created by class
* loaders, but are created automatically as required by the Java runtime.
* The class loader for an array class, as returned by {@link
* Class#getClassLoader()} is the same as the class loader for its element
* type; if the element type is a primitive type, then the array class has no
* class loader.
*
*
Applications implement subclasses of ClassLoader in order to
* extend the manner in which the Java virtual machine dynamically loads
* classes.
*
*
Class loaders may typically be used by security managers to indicate
* security domains.