Question
Consider the following Java code: public class Product { private String name; private double price; public Product(String name, double price) { this.name = name; this.price = price; } public String getName() { return name; } public void setPrice(double newPrice) { if (newPrice > 0) { this.price = newPrice; } else { System.out.println("Price cannot be negative."); } } } This code demonstrates encapsulation by:
More IT Operating System Questions
- Which CPU scheduling algorithm assigns each process a fixed small time slice (quantum) and cycles through the ready queue, making it well suited for time-s...
- Which feature of Big Data refers to the speed of data generation and processing?
- What is the cardinality of the set {1,2,3,5,4} ?
- The ability of the device to give identical output when repeat measurement are made with the same input is defined as________
- Which essential characteristic of cloud computing, as defined by NIST, refers to a consumer's ability to automatically provision computing resources withou...
- A file of size 4 MB needs to be transmitted over a link with a bandwidth of 2 Mbps. Ignoring propagation delay and protocol overhead, what is the transmiss...
- In a code flow involving frequent insertions and deletions, which type of Binary Search Tree is preferred to guarantee O(log n) time complexity for these o...
- A system uses 4 KB pages and a 32-bit virtual address. How many address bits identify the page offset?
- The OS component responsible for managing memory, processes, devices, and files is called:
- What is the primary goal of abstraction in computer science?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)