Author: Rahul

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Java is an object orientied programming languege. In Java you can use Integer.parseInt() or Integer.valueOf() functions to convert String value to an int value. In any case String is not a convertible then NumberFormatException will occur. #1. Using Integer.parseInt() Integer.parseInt() converts string value and returns an int primitive as result. For below example, first, we store 5 as a string value to id variable. Then convert it to integer and save to result variable.

Save the above content in ConvsertStringToInt1.java file and compile and run this program. Compile: javac ConvertStringToInt1.java Run: java ConvertStringToInt1 5 #2. Using Integer.valueOf() Integer.valueOf() also…

Read More

If you have already installed Java on Windows systems. Then you need to set the JAVA_HOME environment variable to make it work properly. Additionally, you also need to add java bin folder location in PATH environment variable. This tutorial will help you to set JAVA_HOME on Windows 7/8/10 operating systems. Step 1 – Edit Environment Variables You can set the environment variables by opening the system properties: Type sysdm.cpl on run window or Right-click on My Computer and select Properties. Go to Advanced tab. Click Environment Variables… button. Step 2 – Set JAVA_HOME on Windows Now click on the New…

Read More

Go, also known as Golang, is a popular open-source programming language developed by Google. It’s known for its simplicity, efficiency, and strong support for concurrent programming. In this guide, we will walk you through the steps to install Go on a Debian Linux system. Prerequisites A Debian-based Linux system Access to a terminal Basic knowledge of Linux commands Step 1: Update Your System Before installing any new software, it’s a good practice to update your system. Open your terminal and run the following commands: sudo apt update sudo apt upgrade This process will ensure that all your system’s packages are…

Read More

PHP, a server-side scripting language, is a cornerstone of web development, enabling dynamic content creation on web pages. One fundamental aspect of many PHP applications is the ability to handle and manipulate date and time. This article provides an in-depth guide on how to retrieve and format the current date and time in PHP, a crucial skill for any developer working with scheduling, timestamps, and time-sensitive data. Date and Time Functions in PHP PHP offers a range of built-in functions for date and time manipulation. The most commonly used functions are: date(): This function returns the current date and time…

Read More

JSON, or JavaScript Object Notation, is a lightweight data-interchange format that is easy for humans to read and write. Node.js has built-in support for parsing JSON files, making it a breeze to work with JSON data. To parse a JSON file in Node.js, you can use the built-in JSON module. The JSON module provides an efficient way to parse and stringify JSON data. It also provides a number of helpful methods for working with JSON data. This tutorial will help you to read JSON file using Node.js uses readFile and readFileSync functions of the jsonfile module. Installing Node Module For…

Read More

Accessing computers remotely has become an important part of the IT world especially in today’s scenario where everyone is working from home due to covid19. There are mainly two ways of connecting machines remotely depending on your operating system: SSH for Linux RDP for Windows In this tutorial, we will see how to use SSH to connect to a remote server? What is SSH? SSH stands for Secure Socket Shell and it is a network protocol used to access a system remotely in a secured way. SSH is an application layer protocol and it allows you to access another machine…

Read More

When building web applications, it’s often necessary to access and manipulate the current URL in the web browser. JavaScript provides a simple and easy way to get the current URL in the browser, which can be useful for a wide range of purposes, from tracking user behavior to implementing dynamic navigation menus. In this article, we’ll explore how to get the current URL in the web browser using JavaScript. We’ll cover two methods: using the window.location property and using the document.URL property. Method 1: Using the window.location Property The “window.location” property provides information about the current URL in the browser.…

Read More

Linux/Unix systems keep the details of the system uptime. You may also need to know when the server is running. This tutorial we will use Linux uptime command. What is Uptime? The uptime is the amount of time a system is continuously running since the last start/restart. Check System Uptime in Linux You can use the uptime command to find the system uptime. Uptime command is available under procps package. This command also provides the current system time, number of logged in users and current CPU load. uptime 07:33:31 up 174 days, 5:12, 2 users, load average: 0.17, 0.14, 0.17…

Read More

Apache Maven is a powerful project management tool used for managing a project’s build, reporting, and documentation from a central piece of information. If you’re working on Java projects, Maven can help streamline your development process. This guide will walk you through the process of installing Apache Maven on a Windows system. Requirements Before we begin, ensure you have the following prerequisites installed on your system: Java Development Kit (JDK): Maven requires JDK to be installed on your system. You can download it from the official Oracle website or use an OpenJDK version. Ensure that you install JDK, not just…

Read More

Cross-Origin Resource Sharing (CORS) is an essential security feature for modern web applications, allowing web browsers to request resources from different domains securely. By default, web browsers enforce the same-origin policy, which prevents web pages from making requests to a different domain than the one that served the web page. However, sometimes it is necessary to allow cross-origin requests for web applications to function correctly. In this article, we will guide you through enabling CORS in Apache, a widely-used web server, to allow cross-origin requests for your web applications. Step 1: Enable Apache Headers Module To enable CORS in Apache,…

Read More