
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
Found 33676 Articles for Programming

7K+ Views
Zipping a folder recursively means compressing a folder along with all its subfolders and files. In this article, we will explore all the possible ways to zip a folder recursively using Python. Using zipfile and os.walk() In Python, we have the methods zipfile() and os.walk() to zip all the folders recursively. This is a manual approach of zipping the available subfolders and files into one. Following is an example that shows how to zip a folder recursively using Python - import zipfile import os def zip_folder_manual(folder_path, zip_path): with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zipf: ... Read More

6K+ Views
Association of method call with the method body is known as binding in Java. There are two kinds of binding. Static binding In static binding the method call is bonded with the method body at compile time. This is also known as early binding. This is done using static, private and, final methods. Example class Super{ public static void sample(){ System.out.println("This is the method of super class"); } } Public class Sub extends Super{ Public static void sample(){ ... Read More

20K+ Views
In Python, pip is a standard tool which is used to install third-party packages in our system. By default, pip installs packages into the site-packages directory of the current Python environment but in some cases, such as restricted environments or creating portable apps, we may need to install packages into a different directory. Then we can use the pip's --target option. Syntax Following is the syntax of using the pip command while installing a python package in a different directory - pip install --target The above command tells pip to install the specified package and all its ... Read More

7K+ Views
You can access the private methods of a class using java reflection package.Step1 − Instantiate the Method class of the java.lang.reflect package by passing the method name of the method which is declared private.Step2 − Set the method accessible by passing value true to the setAccessible() method.Step3 − Finally, invoke the method using the invoke() method.Exampleimport java.lang.reflect.Method; public class DemoTest { private void sampleMethod() { System.out.println("hello"); } } public class SampleTest { public static void main(String args[]) throws Exception { Class c = Class.forName("DemoTest"); Object obj = c.newInstance(); ... Read More

804 Views
An abstract method is the one which has no definition and declared abstract. In short, an abstract method contains only method signature without body. To use this method, you need to inherit this method by extending the class and provide the method definition. Example public abstract class Employee{ private String name; private String address; private int number; public abstract double computePay(); }

598 Views
A native method is the one whose method implementation is done in other languages like c++ and Java. These programs are linked to Java using JNI or JNA interfaces. The difference between normal method and native method is That the native method declaration contains native keyword and, the implementation of the method will be other programming language. Example Tester.java public class Tester { public native int getValue(int i); public static void main(String[] args) { System.loadLibrary("Tester"); System.out.println(new Tester().getValue(2)); ... Read More

4K+ Views
In Python, we can extract a specific part of a file path of the directory using built-in modules such os.path and pathlib. Extracting a part of the file path is commonly needed when working with file systems, data processing, or scripts that handle files dynamically. Using os.path Module The os.path module in Python provides functions to manipulate files and directory paths. We can use this module to extract directory names, file names, and traverse up directory levels. Example Following is an example, which shows how to use the os.path module to extract a directory path from a full file path ... Read More

208 Views
Whenever, you want to pass different number of arguments each time you call a method you should use vararg methods. This example creates sumvarargs() method which takes variable no of int numbers as an argument and returns the sum of these arguments as an output. Example Live Demo public class Main { static int sumvarargs(int... intArrays) { int sum, i; sum = 0; for(i = 0; i< intArrays.length; i++) { ... Read More