- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 34494 Articles for Programming
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
1K+ Views
Typecasting is converting one data type to another.Up-casting − Converting a subclass type to a superclass type is known as up casting.Exampleclass Super { void Sample() { System.out.println("method of super class"); } } public class Sub extends Super { void Sample() { System.out.println("method of sub class"); } public static void main(String args[]) { Super obj =(Super) new Sub(); obj.Sample(); } }Down-casting − Converting a superclass type to a subclass type is known as downcasting.Exampleclass Super { void Sample() { ... Read More
![Rajendra Dharmkar](https://www.tutorialspoint.com/assets/profiles/9963/profile/60_124173-1512724240.jpg)
653 Views
To touch all the files recursively, you need to walk the directory tree using os.walk and add touch all the files in it using os.utime(path_to_file). exampleimport os # Recursively walk the tree for root, dirs, files in os.walk(path): for file in files: # Set utime to current time os.utime(os.path.join(root, file))In Python 3.4+, you can directly use the pathlib module to touch files. examplefrom pathlib import Path import os # Recursively walk the tree for root, dirs, files in os.walk(path): for file in files: Path(os.path.join(root, file)).touch()Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
6K+ Views
Multiple inheritances lead to ambiguity.For example, if there is a class named Sub and there are two classes Super1 and Super2 and if both contains a method named sample(). And if the class sub inherits both classes Super1 and Super2 then there will be two copies of the sampling method one from each superclass and it is ambiguous to decide which method to be executed.
![Rajendra Dharmkar](https://www.tutorialspoint.com/assets/profiles/9963/profile/60_124173-1512724240.jpg)
5K+ Views
It is known that file compression is a routine task in software development and data management in Python. The act of zipping folders recursively is a valuable skill that allows you to compress not only the top-level folder but also all its subdirectories and files; this results in creating a well-organized and space-efficient archive. Python, with its versatility and extensive standard library, makes available multiple approaches to achieve this task effectively. In this comprehensive and exhaustive article, we will explore various methods of how to zip a folder recursively using Python. We have provided step-by-step explanations and code examples to ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
5K+ 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
![Rajendra Dharmkar](https://www.tutorialspoint.com/assets/profiles/9963/profile/60_124173-1512724240.jpg)
7K+ Views
In Python, there is a vast ecosystem of libraries and packages, and it provides developers with a multitude of tools to build powerful applications. For example, the "pip" package manager simplifies the process of installing Python packages from the Python Package Index (PyPI) into the default system−wide site−packages directory. However, in some cases, you might want to install packages into a different directory to maintain better control over dependencies and avoid potential conflicts. In this detailed article, we will explore various methods to install a Python package into a different directory using pip. We will provide step-by-step explanations and code ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
5K+ 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
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
603 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(); }
![Swarali Sree](https://www.tutorialspoint.com/assets/profiles/13515/profile/60_84115-1512649510.jpg)
401 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