logo

Crowdly

Object Oriented Programming

Шукаєте відповіді та рішення тестів для Object Oriented Programming? Перегляньте нашу велику колекцію перевірених відповідей для Object Oriented Programming в lms.upes.ac.in.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

The following code has error(s).

public class Demo{  

  void m(){  

    throw new java.io.IOException("Exception");

    System.out.println("1");

  }  

  void n(){  

    m();

    System.out.println("2");

  }  

  void p(){  

   try{  

    n();  

   }catch(Exception e){System.out.println("3");}  

  }  

  public static void main(String args[]){  

   Demo obj=new Demo();  

   obj.p();  

   System.out.println("4");  

  }  

}

/**/

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false"); /**/

Переглянути це питання

The following code has error(s).

class Demo{   

  void msg() {  

    System.out.println("1");  

    }    

}    

    

public class Sample extends Demo{    

  @Override

  void msg() throws Exception {    

    System.out.println("2");    

  }  

  

  public static void main(String args[]) {    

   Demo obj = new Sample();    

   obj.msg();    

  }    

Переглянути це питання
The following code has error(s).

class Demo{   

  void msg() {  

    System.out.println("1");  

    }    

}    

    

public class Sample extends Demo{    

  @Override

  void msg() throws ArithmeticException {    

    System.out.println("2");    

  }  

  

  public static void main(String args[]) {    

   Demo obj = new Sample();    

   obj.msg();    

  }    

}

/**/

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false"); /**/

Переглянути це питання

Final methods can be overloaded but they cannot be overridden.

/**/

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false"); /**/

Переглянути це питання

Which of the following statements are true regarding the HashSet class?

/**/

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false"); /**/

100%
0%
100%
100%
Переглянути це питання

An instance variable cannot be static. But, a local variable can be made static.

/**/

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false"); /**/

Переглянути це питання

Which of the following is a correct declaration of a generic class?

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false");

// Disable copy, paste, text selection, and right-click context menu

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false");

// Prevent new tab and new window shortcuts

window.addEventListener("keydown", function(event) {

if ((event.ctrlKey && event.key === 't') || (event.ctrlKey && event.key === 'n')) {

event.preventDefault();

alert("Opening a new tab or window is not allowed during the quiz.");

// Close the current tab or new window immediately

window.close();

}

});

// Detect and close the tab if the user tries to switch away from it

document.addEventListener("visibilitychange", function() {

if (document.visibilityState === "hidden") {

alert("Please stay on this tab to complete the quiz.");

// Reload the page if user tries to leave the tab

location.reload();

}

});

// Block certain key combinations for opening developer tools

window.addEventListener("keydown", function(event) {

if ((event.ctrlKey && event.shiftKey && event.key === 'i') || // Ctrl+Shift+I

(event.ctrlKey && event.shiftKey && event.key === 'j') || // Ctrl+Shift+J

(event.ctrlKey && event.shiftKey && event.key === 'c') || // Ctrl+Shift+C

(event.ctrlKey && event.key === 'u')) { // Ctrl+U

event.preventDefault();

alert("Developer tools are disabled during the quiz.");

}

});

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false");

0%
0%
0%
100%
Переглянути це питання

When an ArrayList is initialized, a default capacity of ____ is assigned to the ArrayList.

/**/

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false"); /**/

0%
0%
100%
0%
Переглянути це питання

What is the purpose of the diamond operator(<>) in Java generics?

/**/

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false"); /**/

100%
0%
0%
0%
Переглянути це питання

What is the output?

int a=8;  

System.out.println(a++ + a++);  

System.out.println(a<<3);

System.out.println(a<~a&&a++<~a);  

System.out.println(a);

/**/

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false"); /**/

100%
0%
0%
0%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на lms.upes.ac.in?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!