Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 2060 of 3363
554 Views
Http/2 Client API introduced in Java 9. It has more performance improvements over Http/1.1 and also supports server-side push events. This makes the website efficient and faster to browse. Http/2 Client is an incubator module named jdk.incubator.httpclient, which means that all features are still not finalized, and new changes may come in future versions of java. It exports jdk.incubator.http package that contains all public APIs.To use Http/2 Client, we need to use the incubator module, we simply pass the httpclient module into JShell using the "–add-modules" command as belowC:\>jshell -v --add-modules jdk.incubator.httpclient | Welcome to JShell -- Version 9.0.4 | For an introduction type: /help introExamplejshell> import jdk.incubator.http.*; jshell> HttpClient httpClient ... Read More
443 Views
JShell is a REPL tool that allows snippets of code to be run without placing them in classes. This tool provides a way to evaluate declarations, statements, and expressions in Java and no need to create the main() method to test some parts of the code.The command "/debug" can be used to display debugging information for the JShell tool implementation. Once we type the "/debug" command, the debugging mode is on. After enabling the debug mode and type something like a simple addition, or a simple string, then it prints as below.Example-1jshell> /debug | Debugging on jshell> 5+3 Compiling: 5+3 Kind: EXPRESSION_STATEMENT ... Read More
574 Views
In this article, we will learn about the unified JVM logging in Java 9. Logging in the JVM is a great tool for performing root cause analysis, and it is a part of the JDK(Java Development Kit). Starting from JDK 9, the JVM maintainers chose to rebuild the way the JVM logs things. What is Unified JVM Logging? Java 9 can provide a common logging system for JVM components with a detailed level. By using a new command-line option: -Xlog for all logging settings, and unified JVM logging, gives us an easy-to-configure tool to do a root cause analysis (RCA) ... Read More
656 Views
Since Java 9, versioning can be consistent with semantic versioning. The version number can be a non-empty sequence of strings separated by dots. It contains three major parts: major version number, minor version number, and security. The new versioning scheme has documented in Runtime. Version class and version information can be accessed from it.The version numbers have the below format:$MAJOR.$MINOR.$SECURITY(.$otherpart)?$MAJOR is the major version number and incremented when a major version has released that typically changes the platform specification. For JDK 9, this value is 9.$MINOR is the minor version number and incremented for releases that contain bug fixes and enhancements to ... Read More
2K+ Views
In this tutorial, we will be discussing a program to understand virtual functions in C++.Virtual function is the member function defined in the base class and can further be defined in the child class as well. While calling the derived class, the overwritten function will be called.Example Live Demo#include using namespace std; class base { public: virtual void print(){ cout
208 Views
In this tutorial, we will be discussing a program to understand virtual destruction using shared_ptr in C++.To delete the instances of a class, we define the destructor of the base class to be virtual. So it deletes the various object instances inherited in the reverse order in which they were created.Example Live Demo#include #include using namespace std; class Base { public: Base(){ cout
17K+ Views
In this tutorial, we will be discussing a program to understand virtual base class in C++.Virtual classes are primarily used during multiple inheritance. To avoid, multiple instances of the same class being taken to the same class which later causes ambiguity, virtual classes are used.Example Live Demo#include using namespace std; class A { public: int a; A(){ a = 10; } }; class B : public virtual A { }; class C : public virtual A { }; class D : public B, public C { }; int main(){ //creating class D object D object; cout
214 Views
In this tutorial, we will be discussing a program to understand how to use class to implement vector quantities in C++.Vector quantities are the ones which have both magnitude and direction. Here we will be implementing them using classes and then performing basic operations on them.Example Live Demo#include #include using namespace std; class Vector { private: int x, y, z; //components of the Vector public: Vector(int x, int y, int z){ this->x = x; this->y = y; this->z = z; } Vector operator+(Vector ... Read More
295 Views
In this tutorial, we will be discussing a program to understand Type interference in C++ (auto and decltype). In the case of auto keyword, the type of the variable is defined from the type of its initializer. Further, with decltype, it lets you extract the type of variable from the called element. auto type Example Here is the following example of auto-type in C++. #include using namespace std; int main() { auto x = 4; auto y = 3.37; auto ptr = & x; cout
508 Views
In this tutorial, we will be discussing a program to understand trivial classes in C++.When a class/ struct contains explicitly defaulted value inside it, then it is known as Trivial classes. Further trivial classes have their own constructor, assignment operator and destructor.Example//using the default constructor struct Trivial { int i; private: int j; }; //defining your own constructor //and then marking it as default struct Trivial2 { int i; Trivial2(int a, int b){ i = a; } Trivial2() = default; };Output(No output as we are just defining classes here and not creating object instances from them.)