Signup/Sign In

Interview MCQs Test for Core Java - Level 1

This Test will cover complete Java with very important questions, starting off from basics to advanced level.
Q. Which class cannot be a subclass in java?
Q. A Suspended thread can be revived by using?
Q. Which collection class associates values with keys, and orders the keys according to their natural order?
Q. Which methods are utilized to control the access to an object in multi-threaded programming?

Q. In Runnable, many threads share the same object instance. True or False?
Q. Java beans have no types. True or False?
Q. What is the output of this program?
class average {
        public static void main(String args[])
        {
            double num[] = {5.5, 10.1, 11, 12.8, 56.9, 2.5};
            double result;
            result = 0;
            for (int i = 0; i < 6; ++i) 
                result = result + num[i];
	    System.out.print(result/6);
 
        } 
    }
Q. What is the output of this program?
class conversion {
        public static void main(String args[]) 
        {    
             double a = 295.04;
             int  b = 300;
             byte c = (byte) a;
             byte d = (byte) b;
             System.out.println(c + " "  + d);
        } 
    }
Q. What is the output of this program?
class increment {
        public static void main(String args[]) 
        {        
             int g = 3;
             System.out.print(++g * 8);
        } 
    }

Q. Which of these operators is used to allocate memory to array variable in Java?
Q. What is the output of this program?
class array_output {
        public static void main(String args[]) 
        {
            int array_variable [] = new int[10];
	    for (int i = 0; i < 10; ++i) {
                array_variable[i] = i;
                System.out.print(array_variable[i] + " ");
                i++;
            }
        } 
    }
Q. Which statement is static and synchronized in JDBC API?
Q. All raw data types should be read and uploaded to the database as an array of?
Q. The class java.sql.Timestamp is associated with?
Q. Which method executes only once?

Related Tests: