Logo

Java Questions Set 180:

Quiz Mode

Which method of Process class can terminate a process?


1
2
3
4

Solution:

Which one of the following is not an annotation used by JUnit with JUnit4?

1
2
3
4

Solution:

MemberPermission class allows us to get real-time data about a private and protected member of a class 

1
2

Solution:

The collection of strings stored in the heap memory is referred to as the:

1
2
3
4

Solution:

Which Java feature is used to implement runtime polymorphism?

1
2
3
4

Solution:

If superclass and subclass have the same variable name, then which keyword is used for using the superclass variables?

1
2
3
4

Solution:

Which class in the list does not override the equals() and hashCode() methods, inheriting them directly from class Object?

1
2
3
4

Solution:

Which of these statements about strings in Java is incorrect?

1
2
3
4

Solution:

 

public class example {
  int i[] = {0};
  public static void main(String args[]) {
     int i[] = {1};
     change_i(i);
     System.out.println(i[0]);
  }
  public static void change_i(int i[]) {
     i[0] = 2;
     i[0] *= 2;
  }
}

1
2
3
4

Solution:

public class Main 

   {

       public static void main(String args[]) 

        {

           int arr[][] = {{ 1, 2, 3}, { 4 , 5, 6}, { 7, 8, 9}};

            int sum = 0;

            for (int i = 0; i < 3; ++i)

                for (int j = 0; j <  3 ; ++j)

                    sum = sum + array_variable[i][j];

            System.out.print(sum / 5);

        } 

    }


1
2
3
4

Solution: