Returning Objects in Java

    A method can return any type of data, including class type that you create. For example, in the following program, the incrByTen( ) method returns an object in which the value...

Recursion in Java

Java supports recursion.Recursion is the process of defining something in terms of itself. As it relates to Java programming, recursion is the attribute that allows a method to call itself. A...

Let’s make a Calculator

Great! Now let's do some math and get our hands dirty. In python, Maths operations are very simple to perform. You can add, subtract, multiply, divide and even do exponentiation. TRY IT...

Using Objects as Parameters

So far, we have only been using simple types as parameters to methods. However, it is both correct and common to pass objects to methods. For example, consider the following short...

Argument Passing

In general, there are two ways that a computer language can pass an argument to a subroutine. The first way is call-by-value. This approach copies the value of an argument into...

Overloading Constructors

In addition to overloading normal methods, you can also overload constructor ,methods. In fact, for most real – world classes that you create, overloaded constructors will be the norm, not the...

Overloading Methods In Java

In Java it is possible to define two or more methods within the same class that share the same name, as long as their parameter declarations are different. When this is...

Writing Your First Python Program

Well, you have gone through a lot of theory to get you started with your first program. So let’s get your hands dirty. Go to the command prompt if you are on...

How to Install Python on Your System?

Windows Platform Directly go on this link: https://www.python.org/downloads/ and click on the version you wish to install. Run the .exe file and you are good to go. However there are also several different...

Java Enumerations

Version prior to JDK 5 lacked one feature that many programmers felt was needed: enumeration. In its simplest form, an enumeration is a list of named constants. Although Java offered other features...