3:53 pm - Thursday March 24, 2349

Thread Example program for checkAccess()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
*@author :CandidJava.com
*@descriptions : This program explain the function and the use of Check Access()
*/
import java.io.*;
class active implements Runnable
{
public void run()
{
}
}
public class my2
{
public static void main(String[]args)
{
active a=new active();
Thread t=new Thread(a);
Thread t1=new Thread();
t1.start();
t.start();
try
{
t.checkAccess();
System.out.println(t+"has access");
System.out.println(t1+"has access");
}
catch (SecurityException ex)
{
System.out.println("Thread doesn't have access: " + ex);
}
}
}

output
Thread 1 has Access
Thread 2 has Access


							
							
			
Filed in: Z-A All Java Codes

Comments are closed.