428). Which of the following method of Process class can terminate a process?

[A] void kill()
[B]void destroy()
[C] void terminate()
[D]void exit()

Show Answer

429). Standard output variable ‘out’ is defined in which class?

[A]Void
[B]Process
[C]Runtime
[D]System

Show Answer

431). Which of the following is method of System class is used to find how long a program takes to execute?

[A]currenttime()
[B]currentTime()
[C]currentTimeMillis()
[D]currenttimeMillis()

Show Answer

432). Which of these class holds a collection of static methods and variables?

[A]Void
[B]Process
[C]Runtime
[D]System

Show Answer

433). What will be the output of the following Java code?
    class Output 
    {
        public static void main(String args[]) 
        {
            long start, end;   
            start = System.currentTimeMillis();
            for (int i = 0; i < 10000000; i++);
            end = System.currentTimeMillis();
            System.out.print(end - start);
        }
    }

[A]0
[B]1
[C]100
[D] System Dependent

Show Answer

434). What will be the output of the following Java code?
    class Output 
    {
        public static void main(String args[]) 
        {
            byte a[] = { 65, 66, 67, 68, 69, 70 };
            byte b[] = { 71, 72, 73, 74, 75, 76 };  
            System.arraycopy(a , 0, b, 0, a.length);
            System.out.print(new String(a) + " " + new String(b));
        }
    }

[A]ABCDEF ABCDEF
[B]ABCDEF GHIJKL
[C]GHIJKL ABCDEF
[D]GHIJKL GHIJKL

Show Answer

435). What will be the output of the following Java code?
    class Output 
    {
        public static void main(String args[]) 
        {
            byte a[] = { 65, 66, 67, 68, 69, 70 };
            byte b[] = { 71, 72, 73, 74, 75, 76 };  
            System.arraycopy(a, 2, b, 1, a.length-2);
            System.out.print(new String(a) + " " + new String(b));
        }
    }

[A] ABCDEF GHIJKL
[B]ABCDEF GCDEFL
[C]GHIJKL ABCDEF
[D]GCDEFL GHIJKL

Show Answer

436). What will be the output of the following Java code?
    class Output 
    {
        public static void main(String args[]) 
        {
            byte a[] = { 65, 66, 67, 68, 69, 70 };
            byte b[] = { 71, 72, 73, 74, 75, 76 };  
            System.arraycopy(a, 1, b, 3, 0);
            System.out.print(new String(a) + " " + new String(b));
        }
    }

[A]ABCDEF GHIJKL
[B]ABCDEF GCDEFL
[C]GHIJKL ABCDEF
[D] GCDEFL GHIJKL

Show Answer