Code example for Constructor

Methods: isAccessiblesetAccessiblenewInstance

0
			ParcelUuid uuid) throws IOException {
		Constructor<BluetoothSocket> constructor = obtainConstructor();
		BluetoothSocket tmp = null;
 
		try { 
			tmp = constructor.newInstance(type, fd, auth, encrypt, device,
					port, uuid);
		} catch (IllegalArgumentException e) {
		} catch (InstantiationException e) {
		} catch (IllegalAccessException e) {
		} catch (InvocationTargetException e) {
		} 
 
		return tmp;
	} 
 
	private static final Constructor<BluetoothSocket> obtainConstructor() {
		Class<BluetoothSocket> cls = BluetoothSocket.class;
		Constructor<BluetoothSocket> tmp = null;
 
		try { 
			tmp = cls.getDeclaredConstructor(int.class, int.class,
					boolean.class, boolean.class, BluetoothDevice.class,
					int.class, ParcelUuid.class);
			if (!tmp.isAccessible()) {
				tmp.setAccessible(true);
			} 
		} catch (SecurityException e) {
		} catch (NoSuchMethodException e) {
		} 
 
Connect your IDE to all the code out there  Get Codota for Java