Technology Questions

Practice Technology MCQs with answers and explanations. Page 75 of 79.

Category
Interview
Topic
Technology
Page
75 / 79
Mode
Practice

Questions

Open any question to view the answer and explanation.

In a Java interface, when must variables (fields) be initialized, considering that they are implicitly public, static, and final constants?
Open
View answer
In a traditional Java interface (before default and private methods), which of the following method declarations is allowed inside the interface?
Open
View answer
In Java, why are methods declared in an interface always effectively public, and what is the reason for this design?
Open
View answer
In programming languages such as C and C plus plus, which of the following symbols is the scope resolution operator?
Open
View answer
In Java, which kind of inheritance is not directly supported through classes and must be simulated using interfaces or other design patterns?
Open
View answer
Consider the following Java program using threads: public class Threads2 implements Runnable { public void run() { System.out.println("run."); throw new RuntimeException("Problem"); } } public class TestThreads2 { public static void main(String[] args) { Thread t = new Thread(new Threads2()); t.start(); System.out.println("End of method."); } } Which of the following outputs best describes what happens when this program runs?
Open
View answer
Given the abstract class public abstract class Shape { private int x; private int y; public abstract void draw(); public void setAnchor(int x, int y) { this.x = x; this.y = y; } } which of the following class declarations uses the Shape class correctly as a subclass?
Open
View answer
Given the abstract class public abstract class Shape { private int x; private int y; public abstract void draw(); public void setAnchor(int x, int y) { this.x = x; this.y = y; } } which class declaration for Circle correctly extends Shape according to Java rules?
Open
View answer
In Java, for a declaration like X implements Y, Z, which of the following statements about X, Y, and Z is correct?
Open
View answer
In Java, what are class variables, member (instance) variables, and local variables, and how do they differ in scope and lifetime?
Open
View answer
In Java Database Connectivity (JDBC), what is a JDBC driver and what role does it play in database access from Java applications?
Open
View answer
In JDBC, what are the main steps required to execute a SQL query from a Java program, from establishing a connection to processing the results?
Open
View answer
In Java, what is the difference between a constructor and a method in terms of purpose, name, return type, and how they are called?
Open
View answer
In Java, what is an abstract class, and how does it differ from a regular concrete class in terms of instantiation and method definitions?
Open
View answer
In Java, how do you define an abstract class in code, and what syntax indicates that a class is abstract?
Open
View answer
In Java, what is the difference between an array and an ArrayList in terms of size, type storage, and available operations?
Open
View answer
In Java object oriented programming, what is the “diamond problem” in multiple inheritance and why is it considered an ambiguity issue?
Open
View answer
In the Java platform, which core security mechanism is used to protect users and systems from untrusted code?
Open
View answer
In Java object oriented programming, what is encapsulation and how does it help in hiding internal data?
Open
View answer
In object oriented Java programming, what is inheritance and how does it allow one class to reuse another class's behavior?
Open
View answer

Practice smarter

Solve a few questions daily and revisit weak topics regularly to improve accuracy.