Question:- What is data abstraction and how can we achieve data abstraction?
Answer:- It is one of the most important features of OOP. It allows us to show only essential data or information to the user and hides the implementation details from the user. A real-world example of abstraction is driving a car. When we drive a car, we do not need to know how the engine works (implementation) we only know how ECG works. There are two ways to achieve data abstraction • Abstract class • Abstract method
Question:- What are the levels of data abstraction?
Answer:- There are three levels of data abstraction: • Physical Level: It is the lowest level of data abstraction. It shows how the data is actually stored in memory. • Logical Level: It includes the information that is actually stored in the database in the form of tables. It also stores the relationship among the data entities in relatively simple structures. At this level, the information available to the user at the view level is unknown. • View Level: It is the highest level of data abstraction. The actual database is visible to the user. It exists to ease the availability of the database by an individual user.
Question:- What are the types of variables in OOP?
Answer:- There are three types of variables: 1. Instance Variable: It is an object-level variable. It should be declared inside a class but must be outside a method, block, and constructor. It is created when an object is created by using the new keyword. It can be accessed directly by calling the variable name inside the class. 2. Static Variable: It is a class-level variable. It is declared with keyword static inside a class but must be outside of the method, block, and constructor. It stores in static memory. Its visibility is the same as the instance variable. The default value of a static variable is the same as the instance variable. It can be accessed by calling the class_name.variable_name. 3. Local Variable: It is a method-level variable. It can be declared in method, constructor, or block. Note that the use of an access modifier is not allowed with local variables. It is visible only to the method, block, and constructor in which it is declared. Internally, it is implemented at the stack level. It must be declared and initialized before use. Another type of variable is used in object-oriented programming is the reference variable. 4. Reference Variable: It is a variable that points to an object of the class. It points to the location of the object that is stored in the memory.
Question:- Is it possible to overload a constructor?
Answer:- Yes, the constructors can be overloaded by changing the number of arguments accepted by the constructor or by changing the data type of the parameters.
Question:- Can we overload the main() method in Java also give an example?
Answer:- es, we can also overload the main() method in Java. Any number of main() methods can be defined in the class, but the method signature must be different.
Question:- Consider the following scenario: If a class Demo has a static block and a main() method. A print statement is presented in both. The question is which one will first execute, static block or the main() method, and why?
Answer:- JVM first executes the static block on a priority basis. It means JVM first goes to static block even before it looks for the main() method in the program. After that main() method will be executed.
Question:- What is Node.js?
Answer:- Node.js is Server-side scripting which is used to build scalable programs. It is a web application framework built on Google Chromes JavaScript Engine. It runs within the Node.js runtime on Mac OS, Windows, and Linux with no changes. This runtime facilitates you to execute a JavaScript code on any machine outside a browser.
Question:- Is Node.js free to use?
Answer:- Yes. It is released under MIT license and is free to use.
Question:- Is Node a single threaded application?
Answer:- Yes. Node is a single-threaded application with event looping.
Question:- What is the purpose of Node.js?
Answer:- These are the following purposes of Node.js: • Real-time web applications • Network applications • Distributed systems • General purpose applications
Question:- What are the advantages of Node.js?
Answer:- Following are the main advantages of Node.js: • Node.js is asynchronous and event-driven. All API?s of Node.js library are non-blocking, and its server doesnt wait for an API to return data. It moves to the next API after calling it, and a notification mechanism of Events of Node.js responds to the server from the previous API call. • Node.js is very fast because it builds on Google Chrome?s V8 JavaScript engine. Its library is very fast in code execution. • Node.js is single threaded but highly scalable. • Node.js provides a facility of no buffering. Its application never buffers any data. It outputs the data in chunks.
Question:- Explain Node.js web application architecture?
Answer:- A web application distinguishes into 4 layers: • Client Layer: The Client layer contains web browsers, mobile browsers or applications which can make an HTTP request to the web server. • Server Layer: The Server layer contains the Web server which can intercept the request made by clients and pass them the response. • Business Layer: The business layer contains application server which is utilized by the web server to do required processing. This layer interacts with the data layer via database or some external programs. • Data Layer: The Data layer contains databases or any source of data.
Question:- What do you understand by the term I/O?
Answer:- The term I/O stands for input and output. It is used to access anything outside of your application. The I/O describes any program, operation, or device that transfers data to or from a medium or another medium. This medium can be a physical device, network, or files within a system. I/O is loaded into the machine memory to run the program once the application starts.
Question:- How many types of API functions are available in Node.js?
Answer:- There are two types of API functions in Node.js: • Asynchronous, Non-blocking functions • Synchronous, Blocking functions
