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 3305 of 3366
3K+ Views
Yes, we can overload the main method in Java, but When we execute the class JVM starts execution with public static void main(String[] args) method. Example Live Demo public class Sample{ public static void main(){ System.out.println("This is the overloaded main method"); } public static void main(String args[]){ Sample obj = new Sample(); obj.main(); } } Output This is the overloaded main method
9K+ Views
Transferring files from one server to another is a most common task in system administration, DevOps and development workflows. The tools such as scp and rsync are used for the file transfer. Python provides different methods and tools to transfer the files from one server to another using a third party libraries such as paramiko and SCPClient. Using Paramiko and SCP for Secure Transfers When we want to copy files securely from one server to another using Python, we can use the libraries Paramiko and SCPClient together. Paramiko is a Python library that helps to implement SSHv2 protocol. This is ... Read More
3K+ Views
Overloading is the mechanism of binding the method call with the method body dynamically based on the parameters passed to the method call. If you observe the following example, it contains two methods with same name, different parameters and if you call the method by passing two integer values the first method will be executed and, if you call by passing 3 integer values then the second method will be executed.It is not possible to decide to execute which method based on the return type, therefore, overloading is not possible just by changing the return type of the method. Example ... Read More
2K+ Views
When super class and sub class contains same method including parameters and if they are static. The method in the super class will be hidden by the one that is in the sub class. This mechanism is known as method hiding. Example Live Demo class Demo{ public static void demoMethod() { System.out.println("method of super class"); } } public class Sample extends Demo { public static void demoMethod() { System.out.println("method of sub class"); } public static void main(String args[] ) { Sample.demoMethod(); } } Output method of sub class
2K+ Views
When super class and the sub class contains same instance methods including parameters, when called, the super class method is overridden by the method of the sub class. WIn this example super class and sub class have methods with same signature (method name and parameters) and when we try to invoke this method from the sub class the sub class method overrides the method in super class and gets executed. Example Live Demo class Super{ public void sample(){ System.out.println("Method of the Super class"); } } public ... Read More
3K+ Views
In Python, when performing file operations such as creating or renaming files, one of the limitations is the maximum length limit of a file name, and when we exceed this limit, then results in errors such as OSError: [Errno 36] File name too long. Using os.pathconf() function In Python, the os.pathconf() function is used to get system-specific configuration values related to files and directories. This function also helps in checking limits such as the maximum file name length or the maximum path length allowed by the file system. Syntax Following is the syntax of using the os.pathconf() function - os.pathconf(path, name) ... Read More
4K+ Views
In Python, there is no fixed maximum file size that we can open. Python can open files of any size as long as the operating system and file system support until there is enough memory and disk space available. The limit of maximum file size comes with the system architecture, i.e., 32-bit, 64-bit, the file system, such as FAT32, NTFS, ext4, and how the file is processed in the code. System and File System Limits Following are the system and file system limits - FAT32 – Maximum file size: 4 GB NTFS (Windows) – Supports ... Read More
2K+ Views
Python provides a built-in module called zipfile that allows us to create, read, write, and extract ZIP archives. When we want to extract only specific files, such as all .txt files, then we can perform filtering of the file names using string methods such as endswith(). A ZIP file is one of the archive formats which is used to compress one or more files into a single file to easily store and transfer data. It reduces the file size and keeps all related files compressed together for sharing over the internet and for saving disk space. Steps involved in ... Read More
21K+ Views
A TAR file is abbreviated as Tape Archive, which is an archive format used mainly in Unix and Linux environments. The Tar file is used to collect more number of files into a single file, which makes it easier to share or backup together. In Python, when we want to work with TAR files, we can use the tarfile module, which allows us to create, read and extract TAR archives programmatically. In this article, we will explore how to extract the files from tar file by using Python. Extracting all files from a"tar" file The extractall() method in Python is ... Read More
