574). Which of the interface contains all the methods used for handling thread related operations in Java?

[A]Runnable interface
[B]Math interface
[C]System interface
[D]ThreadHandling interface

Show Answer

575). Which of these class is used to make a thread?

[A]String
[B]System
[C]Thread
[D]Runnable

Show Answer

578). What will be the output of the following Java program?
    class newthread implements Runnable 
    {
	Thread t1,t2;
        newthread() 
        {
            t1 = new Thread(this,"Thread_1");
            t2 = new Thread(this,"Thread_2");
            t1.start();
            t2.start();
	}
	public void run() 
        {
            t2.setPriority(Thread.MAX_PRIORITY);	
	    System.out.print(t1.equals(t2));
        }    
    }
    class multithreaded_programing 
    {
        public static void main(String args[]) 
        {
            new newthread();        
        }
    }

[A]true
[B]false
[C]truetrue
[D]falsefalse

Show Answer

579). What will be the output of the following Java program?
    class newthread implements Runnable 
    {
	Thread t;
        newthread() 
        {
            t = new Thread(this,"New Thread");
            t.start();
	}
	public void run()
        {
            t.setPriority(Thread.MAX_PRIORITY);	
            System.out.println(t);
	}
    }
    class multithreaded_programing 
    {
        public static void main(String args[]) 
        {
            new newthread();        
        }
    }

[A]Thread[New Thread,0,main]
[B]Thread[New Thread,1,main]
[C]Thread[New Thread,5,main]
[D]Thread[New Thread,10,main]

Show Answer

580). What will be the output of the following Java program?
    class newthread implements Runnable 
    {
	Thread t;
        newthread() 
        {
            t = new Thread(this,"My Thread");
            t.start();
	}
    }
    class multithreaded_programing 
    {
        public static void main(String args[]) 
        {
            new newthread();        
        }
    }

[A]My Thread
[B]Thread[My Thread,5,main]
[C]Compilation Error
[D]Runtime Error

Show Answer

581). What will be the output of the following Java program?
    class newthread implements Runnable 
    {
	Thread t;
        newthread() 
        {
            t = new Thread(this,"My Thread");
            t.start();
	}
	public void run() 
        {
	    System.out.println(t.getName());
	}
    }
    class multithreaded_programing 
    {
        public static void main(String args[]) 
        {
            new newthread();        
        }
    }

[A] My Thread
[B]Thread[My Thread,5,main]
[C] Compilation Error
[D]Runtime Error

Show Answer

582). What will be the output of the following Java program?
    class newthread implements Runnable 
    {
	Thread t;
        newthread() 
        {
            t = new Thread(this,"My Thread");
            t.start();
	}
	public void run() 
        {
	    System.out.println(t);
	}
    }
    class multithreaded_programing 
    {
        public static void main(String args[]) 
        {
            new newthread();        
        }
    }

[A] My Thread
[B]Thread[My Thread,5,main]
[C]Compilation Error
[D]Runtime Error

Show Answer