Java Program To Perform Arithmetic Operation Using Method Overloading

The Java programming language provides operators that perform addition, subtraction, multiplication, and division. Arithmetic Expressions. For example, some courses teach how to perform input/output using streams or readers/writers, others teach graphical user interface construction, and yet others rely on a tool or library that handles input/output. I want to perform basic arithmetic operations like addition, subtraction, multiplication and division using only one generic method per operation for wrapper types like Integer, Float, Double (excluding BigDecimal and BigInteger). Java + operator and Operator overloading An operator is said to be overloaded if it can be used to perform more than one functions. my question is here: Q. Examples of the implementation of built-in operator functions "Friendly" operator functions: differences, implementation. JAVA for Beginners Riccardo Flask 6 | P a g e Part 1 - Getting Started The Java Development Kit – JDK In order to get started in Java programming, one needs to get a recent copy of the Java JDK. Arithmetic Operators in Java. For a Class to be executable, it must have a main method. This is called operator overloading. This program describes and demonstrates Simple Program for Binary Operator Overloading Using C++ Programming with sample output,definition,syntax. Java program to print or calculate addition of two numbers with sample outputs and example programs. That’s when different meanings are implied by the code itself. The example defines a Vector2D structure for a two-dimensional position vector (x, y) , followed by a definition of an operator method to add together instances of the Vector2D structure:. Java has a set of basic variable manipulation operations. 133 ISBN 978-616-551-368-5. After that we write the following code in the Program class. Java method overloading tutorial example. Overload of basic arithmetic operators +, -, *, /. You have already seen how to use Java to read and write strings of text. Write a C++ program to create an object of a class called 'employee' containing the employee code, name, designation, basic salary, HRA, DA, gross salary as data members. class extension. There are two ways to overload the method in java. This program allows the user to enter the size, and the One Dimensional Array elemnts. Method Overloading: A class having multiple methods with same name but different parameters is called Method Overloading. Steve Haines addresses all of the mathematical operations you can perform in Java on primitive data types. Some are potential trouble (e. How to divide two numbers without using division (/) operator in java / How to find remainder of division of two numbers using minus (-) operator / Java program to find remainder of division using - | coDippa. Answer: Overloading is the phenomenon when two or more different methods (method overloading) or operators (operator overloading) has the same representation. 3a) Use System. You don't use overloading to return an arithmetic function of the attributes. NET platform. This java example program also expain the concepts for Basic Programs. Arithmetic operators, Data types, Basic Input/Output. My << and >> are friends of Rational class. The binary operator + is overloaded in the sense that the operation performed is determined by the type of the operands. Learn to code in Java and improve your programming and problem-solving skills. Simple assignment. So I have a Rational class. Operator overloading allows operators to be redefined and used where one or both of the operands are of a certain class. Write A Method That Uses For-loop To Perform? Arithmetic Methods Whose Main Method Holds Two Integer Variables; JAVA Calculator - Equals Method To Return Appropriate Value Using Standard Arithmetic; Program To Simulate Operation Of Simple Robot ; Final And Static Method? What Is The Impact Of Declaring A Method As Final. However, in defense of Java, operator overloading can sometimes get very tricky. 3: Java Data Types: a: Write a Java program to count the letters, spaces, numbers and other characters of an input string. lang package. In function overloading compiler detect which method is call actually throw the parameters passed to the methods. handleOptions(): This method takes two double inputs from the user and create a complex object (A) and calls different methods of A to perform different arithmetic operations on it. First you should be familiar with the term "parameter". In ANSI FORTRAN 66 or later, COMPLEX is a built-in data type with full access to intrinsic arithmetic operations. In some programming languages, function overloading or method overloading is the ability to create multiple functions of the same name with different implementations. Method overloading is a programming technique that allows developers to use the same method name multiple times in the same class, but with different parameters. So I am making a rational number class. operator overloading? We'll compare below, for different cases, the "same" code in Java and C++, to have an idea of which kind of coding style is clearer. Table 2 summarizes the methods and functions that return expressions for use in constraints. You will learn one by one all these operators in few next chapters. The four basic operations of arithmetic are covered. If we have to perform only one operation, having same name of the methods increases the readability of the program. ? How to create and run a simple Java Program ?. I would like a review of my program, and I would also like to know if. For example, in our code, if overloading was not supported by Java, we would have to create method names like sum1, sum2, … or sum2Int, sum3Int, … etc. Shell Script to Perform String Comparison. Method overloading is used to increase the readability of the program. C Program for Arithmetic Operations using Switch statement. A First Example. pow method instead) but it's possible to implement integer and floating power exponentiation (with integer exponents) using infix extension functions which look like non-symbolic operators for these actions: // version 1. Write an event driven program to perform the arithmetic operations as shown in the interface. Arithmetic operators, Data types, Basic Input/Output. The code is designed to transport programs efficiently to multiple platforms. Now that we know that code can be sabotaged even through the pristine Java methods, we can ask ourselves about the real use of operator overloading in C++? Clear and natural notation: methods vs. This page contains the C++ solved programs/examples with solutions, here we are providing most important programs on each topic. 1 Are you new to programming? 2. Using the correct type of END identifier for each block makes it easier to find blocks that you have not properly terminated. effect analysis. Operator Overloading is the ability to add (and replace) operator definitions to user defined types. STEP 2: Declare the class name as fn with data members and member functions. Operator overloading (C# reference) 07/05/2019; 3 minutes to read; In this article. : Note: First create a directory by name "Arithmetic" and move to that directory, create the following file and compile the file in the same directory. Java is among the most popular programming languages out there, mainly because of how versatile and compatible it is. We can perform cloning only for cloneable objects and object is. For example, the + operator adds two integer values but concatenates two strings. Next, it will perform the Arithmetic Operations such as Addition, Subtraction, Multiplication, and Division using those two arrays. Programming9 | Programs and Tutorials Search. C program for addition, subtraction, multiplication, division and modulus of two numbers using a function. you can create tow different methods int add( int , int ) String add(String , String. At present that's not necessary. (Java does not support operator overloading but it does support the overloading and overriding of methods. The methods in the Math class are all static, so you call them directly from the class, like this:. In Java, polymorphism is taking place when an object is accessed in multiple ways, such as - When an object is accessed by using the reference variable of its own class and when an object is accessed by using the reference variable of its superclass. Operators are used to perform operations on variables and values. power (and usually have to cast both to double). Listing 1 shows a single method whose parameters differ in number, type, and order. Java Program to Perform Arithmetic Operations on Array using For Loop. Overloading Methods If a class have multiple methods by same name but different parameters, it is known as Method Overloading. C++ program to perform arithmetic operations of two complex numbers using operator overloading. This program generates the following output: Java Method Overload. operator overloading? We'll compare below, for different cases, the "same" code in Java and C++, to have an idea of which kind of coding style is clearer. We add overloaded methods to eliminate complexity and enhance performance. java file, and compile. Here addition, subtraction, multiplication and division. For example, the preceding statement can be written as: i +=8; //This is same as i = i+8; The += is called the addition assignment operator. The point of this exercise is to (1) use some of the arithmetic operators, and (2) start thinking about compound entities (like time of day) that are represented with multiple values. Java (Computer program language). Almost all arithmetic operator can be overloaded to perform arithmetic operation on user-defined data type. Lesson 1: Use Java operators; including parentheses to override operator precedence 1. Here the assignment will be done by converting “Ecode” which is of basic or primary data type into the class type. Method overloading is one of the ways through which java supports polymorphism. This example shows how method overloading is done by having different number of parameters Example : class DisplayOverloading { public void disp(char c) { System. In addition, operators tend to have very specific meaning, and most programmers don't expect operators to do a lot of work, so overloading operators can be abused to make code unreadable. The selective results found that the traditional operatorso of modifying operands and statements give little e ectiveness to mutation testing. One of the nice features of C++ is that you can give special meanings to operators, when they are used with user-defined classes. The Arithmetic Operators. Also, write a program to use the package. Operators are used to perform operations on variables and values. Multiplication is denoted by an asterisk (*). Java arithmetic operators perform addition, subtraction, multiplication, division, and modulo operations. Floating-point arithmetic might produce imprecise results. int, float and double etc in java. Operators In Java: Java Operators are special symbols that perform specific operations on operands and find the result. VINTAGE 1974 Playskool #856 LINCOLN LOGS Scout Set Playset in Tube 177 Lid,Ty Tracker The Basset Beanie Baby June 5, 1997 Retired,PURINA Set 24 Dadini Rabbit-Carrots 85 gr Food For cats. println() Method. Java uses a multi-pass compiler, which means that the methods and fields in a program can be defined in any order: Java first reads all the method headers and fields in the file, then in reads all the bodies, checking that they all use the types of these methods and fields correctly. Please note that the questions may test on, but will not be limited to, the topics described in the bulleted text. Therefore Java also contains the Java Math class which contains methods for performing more advanced math calculations in Java. If we have to perform only one operation, having same name of the methods increases the readability of the program. Methods define the operations that can be performed in java programming. The Java Language Specifcation said "There are two kinds of class declarations - normal class declarations and enum declarations". C++ program for the addition of two matrices (use operator overloading). Other shorthand operators are shown below table. In the following Python program we are finding the remainder on dividing the value of x by y. Predefined classes are organized in the form of packages. C# operators. This is, of course, just a guess. Operator Overloading. In order to explain the concept we have create two classes Loan and PersonalLoan. Let’s look at each type of operator in details with examples. Addition of two numbers program is quite a simple one, we do also write the program in five different ways using standard values, command line arguments, classes and objects, without using addition+ operator, method, BufferedReader with sample outputs and code. view more java software development language tutorials on THIS PAGE. In this program X, Y, and Z are objects of class num. com) From simple calculator operations to large-scale programming and interactive document preparation, Mathematica is the tool of choice at the frontiers of scientific research, in engineering analysis and modeling, in technical education from high school to graduate school, and wherever quantitative methods are used. If two or more method have same name and same parameter list but differs in return type are not said to be overloaded method. Through it, we override a magic method to be able to use an operator on a custom class. The process of using the same symbol for more than one operation is called operator overloading. To perform a math (Methamthical) operation in program or application in java, Method Overloading. BigInteger operations are substantially slower than built-in integer types. The Internals of Operations Like len() and []. Arithmetic operators, Data types, Basic Input/Output. Arithmetic operators are applied on integer and floating-point and not on boolean types. STEP: 2 for I=1 to n do Get Node[1] End for STEP: 3 Get E,The number of edges in the graph. Thus the number -5 is treated by bitwise operators as if it were written "1111111111111111111011". For such a small program you would not use three different methods, of course, but this shows how overloaded methods are defined and used. 01010101010 … so it too will misbehave in Java just the way it does with decimal arithmetic. We can perform cloning by using clone() of the object class. com Source Codes Software Programs C++ Programs Advanced programs C++ program to perform arithmetic operations of two complex numbers using operator overloading C++ program to perform arithmetic operations of two complex numbers using operator overloading. Collection of codes on C programming, Flowcharts, JAVA programming, C++ programming, HTML, CSS, Java Script and Network Simulator 2. Computer Programming I - Class. Java program to multiply N numbers without using * operator Write a Java program to multiply N numbers without using * multiplication operator. An operation is atomic when you can safely perform the operation in parallel on multiple threads without using the synchronized keyword or locks as shown in my previous tutorial. Blog about Java, Python, Database, Big data- NoSQL(Cassandra), Hadoop, ElasticSearch and related technologies. operator overloading is a language design choice - personally, i think that it makes a program written using overloading more difficult to understand and i strongly support the 'programs are write once(ish. Solutions are available here. Alert dashboard system and method from event clustering Dec 20, 2016 - Moogsoft, Inc. Using method overloading, We can create multiple methods with same name in same class to perform same action in different ways (using different number of arguments and it's datatypes). Although you do not need to write overloaded operators every day, this feature certainly puts the latest version of VB. Java program to print or calculate addition of two numbers with sample outputs and example programs. Arithmetic operators perform the same basic operations you would expect if you used them in mathematics. In our next tutorial, we shall go through another Object Oriented Concept - Inheritance in Java. Constructor Overloading in Java Suppose we have a 'Student' class and while making its object, we want to pass a name of it and if nothing is passed, then name should be "unknown". java is defined by a specification and consists of a programming language, a compiler, core libraries and a runtime ( java virtual machine) The java runtime permit software developers to write program code in other languages than the java programming language which still runs on the java virtual machine. Introduction In Java, when we come across a question that what do you mean by method in Java ?. The concept of unreachable code. C++ program for the addition of two matrices (use operator overloading). net or operator comparison operator in c# c# operato. It is possible because + operator is overloaded by both int class and str class. To perform a math (Methamthical) operation in program or application in java, Method Overloading. But you can use them on the characters' because, in Java, Char is sub-set of the integer. program will compile but cannot run, program throws an exception. 3) Multiplication and division operators are evaluated from left to right. They take two operands and return the result of the mathematical calculation. The toolboxes that overload plus (+) are listed. Every class in Python defines its own behavior for built-in functions and methods. , & in C and C++). Java programming language is used to create secure, portable, high-performance applications. A basic knowledge of object-oriented programming, especially in Java, is assumed. First you should be familiar with the term "parameter". For example, the + operator adds two integer values but concatenates two strings. • For numbers, + means addition. Participants are introduced to object-oriented programming concepts, terminology, and syntax, and the steps required to create basic Java programs using the Alice,. Overloads can differ based on argument types. Java is one of the most popular programming languages. Basic Arithmetic Operators In Java with example program: Basic Arithmetic Operators are sub group of Java Arithmetic Operators which include only addition, subtraction, multiplication and division. This symbol must be used to denote every multiplication; thus to multiply N by 2, we must use 2 * N or N * 2 not 2N. Bestselling programming author Herb Schildt covers the entire Java language, including its syntax, keywords, and fundamental programming principles. By using Method Overloading, we can perform a different tasks with same method name by passing different parameters. A COMPARISON OF MICROSOFT'S C# PROGRAMMING LANGUAGE TO SUN MICROSYSTEMS' JAVA PROGRAMMING LANGUAGE By Dare Obasanjo Introduction. Answer: Overloading is the phenomenon when two or more different methods (method overloading) or operators (operator overloading) has the same representation. Multiplication is denoted by an asterisk (*). ALL Online Courses 75% off for the ENTIRE Month of October - Use Code LEARN75. If two or more method have same name and same parameter list but differs in return type are not said to be overloaded method. Java has one important arithmetical operator you may not be familiar with, %, also known as the modulus or remainder operator. However I still think it was a good decision. The numbers (in an arithmetic operation) are called operands. You don't use overloading to return an arithmetic function of the attributes. For such a small program you would not use three different methods, of course, but this shows how overloaded methods are defined and used. This is not a complete overview of either language. power (and usually have to cast both to double). Java arithmetic operators perform addition, subtraction, multiplication, division, and modulo operations. You can implement C++ operator overloads by providing special member-functions on your classes that follow a particular naming convention. C++ program to swap two numbers using class 2. Process 10 such objects using constructors and destructors. When using several operators in the same expression, one must consider Java's order of precedence. It is overloaded in four versions to handle natural and decimal numbers. Operator overloading means defining what the operators ie + - * / & | etc mean in terms of your object, by writing appropriate methods in the object's code. We can overload static methods too. This is sensible because it makes the type self-contained. Now let us look at the OOP feature of overloading methods in java. The Interface for the Remote Object – The interface should extend java. You cannot use them on boolean types, but you can use them on the char types, since the char type in Java is, essentially a subset of int. class extension. What is Virtual Base Class in C++? 5. After that we write the following code in the Program class. By using Method Overloading, we can perform a different tasks with same method name by passing different parameters. Although you do not need to write overloaded operators every day, this feature certainly puts the latest version of VB. Keyword operator. What is operator overloading Operator overloading as evident from the name itself means the ability to overload the operator to provide extra functionality in addition to its real operational meaning. Operators allow us to modify and manipulate information. Create a class called Complex for performing arithmetic with complex numbers. Java Programming. Java String Examples. Online C++ Operator Overloading programs and examples with solutions, explanation and output for computer science and information technology students pursuing BE, BTech, MCA, MTech, MCS, MSc, BCA, BSc. Java program to calculate or to print area of a circle in a simple method. Check out t. Android C++ C Network Programming C Programming Exception Handling File I/O Function General Inheritance Java Mobile Application Operator Overloading OWL Semantic Web Servlet & JSP SOA Standard Template Library. Why Operator Overloading? One of the many desirable features of C++, is the ability to overload operators in the language to give them new meaning for operands of a specific class. Method Overloading and Operator Overloading Java: Java has method overloading but no operator overloading. The Java math operators are reasonably simple. That is, a type can provide the custom implementation of an operation when one or both of the operands are of that type. Arithmetic operation on complex numbers using function overloading Program Description The program demonstrates the implementation of complex number class and performs simple arithmetic operation using operator overloading. - Tricky scenarios of using + as addition operator - Using + as String concatenation operator - Tricky scenarios of using + as concatenation operator. Java Method Overloading In this article, you’ll learn about method overloading and how you can achieve it in Java with the help of examples. However I still think it was a good decision. Operator Overloading is a good language feature by itself, but furthermore absence of it cause the problem: 1. Java Program to Perform Addition, Subtraction, Multiplication and Division - This Java program perform basic arithmetic operations of two numbers. can always parenthesize Java expressions to indicate which are to be evaluated first. After creating and saving your Java program, compile the program by using the Java Compiler. Operator Overloading. Learn about what Java operators are and how they are used, as well as what Java operators are evaluated first. C++ Program to Add Two Numbers using Operator Overloading. As of 2019, 88% market share of all smartphones run. Amazon, Google, or Microsoft. Fall Semester 2019 Read this first! Online notes are in MS Word '97 format. I would like a review of my program, and I would also like to know if. Unlike most of Java performance books, this guide targets tuning your Java code instead of your JVM settings. Learn C programming, Data Structures tutorials, exercises, examples, programs, hacks, tips and tricks online. Although roughly the same functionality can be implemented by classes in Java, the convenience of operator overloading is still missing. Process 10 such objects using constructors and destructors. Could you run the java program without main method? //I googling here i found,some guys executed the program without having main method. In this exercise, we will pedal bit more and compute results of all arithmetic operations at once. When you need to perform calculations in SQL statement, you use arithmetic expression. This example shows how method overloading is done by having different number of parameters Example : class DisplayOverloading { public void disp(char c) { System. What is Method Overriding in Java? Method overriding is almost the same as Method Overloading with a slight change, overriding has the same method name, with the same number of arguments but the methods present in the different classes. based on our requirements. String is serializable in nature and implements Serializable interface. Why Operator Overloading? One of the many desirable features of C++, is the ability to overload operators in the language to give them new meaning for operands of a specific class. Write a java program to calculate the area of square and rectangle by overloading the area method. Conclusion. I want to make a simple calculator that uses methods effectively. The above program is an example of how performance differs when we use boxing conversion back and forth between primitives and wrappers from a collection, versus normal arithmetic operation from an intarray. Through it, we override a magic method to be able to use an operator on a custom class. Operator Overloading is the ability to add (and replace) operator definitions to user defined types. arraycopy(Object src, int src_position, Object dst, int dst_position, int length); Otherwise, if you want to duplicate the objects, you have to initialize your new array and write a. 3a) Use System. Java has a number of predefined classes which we can use about which we will learn later. Here we have three methods with the same name add(), which means we are overloading this method. Arithmetic operators perform the same basic operations you would expect if you used them in mathematics. For example, type help plus. It will increases the readability of the software program. When the Java program java Argument1 is executed, the Java system first pass the command line arguments (a, b and c) to the main method. Remember that in this case also the return type is not considered as part of the method signature. Method overloading is used to increase the readability of the program. When there are multiple instances of the same precedence, Java reads from left to right. In this program X, Y, and Z are objects of class num. By using Method Overloading, we can perform a different tasks with same method name by passing different parameters. The operation (to be performed between the two operands) is defined by an operator. The Math class in the java. C++ class program to perform complex arithmetic using operator overloading admin We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. The Java operators is an essential thing in Java programming. See following Java program for example. The program supports only floating point value for demonstration purposes. Arithmetic operation on complex numbers using function overloading Program Description The program demonstrates the implementation of complex number class and performs simple arithmetic operation using operator overloading. Overload, notes. It is overloaded in four versions to handle natural and decimal numbers. Java has one important arithmetical operator you may not be familiar with, %, also known as the modulus or remainder operator. The Java programming language provides operators that perform addition, subtraction, multiplication, and division. Java arithmetic operators perform addition, subtraction, multiplication, division, and modulo operations. Write a program to find factorial of a number in J Method Overloading in Java; How to read a text file through Java program. 3b) Use command-line arguments for input to a Java program. We will start now an investigation of many of the operators in C++. Sign in form is opened Click here or press any key to continue. get j=source node; K=destination node; W=Weight 2. Re: Write a program to do basic arithmetical operations using Posted 25 July 2012 - 08:24 AM To save you are problem in the future, you don't compare String literals with the == operator, this will compare the actual object in memory and not the actual string value like you want it to. Java Code The purpose of this Java program is to show how to implement an ActionListener interface for handling JButton button event clicks by using the containing class, an inner class, and an anonymous inner class. Method overloading is one of the ways through which java supports polymorphism. Java Program to Perform Addition, Subtraction, Multiplication and Division - This Java program perform basic arithmetic operations of two numbers. The other form is method overriding. The operators are actually methods defined in respective classes. This Java to C++ transition tutorial gives an overview of the C++ programming language, focusing on the most commonly used features of the language. We cannot overload two methods in Java if they differ only by static keyword (number of parameters and types of parameters is same). The unary and binary arithmetic operators are generic functions: methods can be written for them individually or via the Ops group generic function. The simplest way to convert a floating-point value to an integer is to use a typecast. In addition to these basic arithmetic operators, Java identifies % operator which is used to find the remainder of two operands. Listings produced by the IDL compiler indent each block four spaces to the right of the previous level to make the program structure easier to read. This edition applies to Version 4 Release 2 of IBM Enterprise COBOL for z/OS (program number 5655-S71) and to all subsequent releases and modifications until otherwise indicated in new editions. They are used in common arithmetic and most computer languages contain a set of such operators that can be used within equations to perform a number of types of sequential calculation. STEP: 4 for I=1 to E do 1. NET platform. The unary and binary arithmetic operators are generic functions: methods can be written for them individually or via the Ops group generic function. Overloading Methods If a class have multiple methods by same name but different parameters, it is known as Method Overloading. 3: Java Data Types: a: Write a Java program to count the letters, spaces, numbers and other characters of an input string. By using Method Overloading, we can perform a different tasks with same method name by passing different parameters. Note that, In Java 8, we are provided with the provision to create static and default methods in an interface. Although you do not need to write overloaded operators every day, this feature certainly puts the latest version of VB. Coding and programming classes for elementary, middle-school, and high school students! Full time instructors. Listing 1 shows a single method whose parameters differ in number, type, and order. The left operand will be passed implicitly and can be accessed using the this pointer. Write an event driven program to perform the arithmetic operations as shown in the interface arithematic operators: this is the form heading enter n1 :textbox enter n2 :textbox. The output of this process is a file of Java bytecodes with the file extension. This page contains the C++ solved programs/examples with solutions, here we are providing most important programs on each topic. Following are the types of operators available in Java. set mat[j][k]=10; End for STEP: 5 Stop. Why Operator Overloading? One of the many desirable features of C++, is the ability to overload operators in the language to give them new meaning for operands of a specific class. Arithmetic Operations and Functions Operations. To use + operator with custom objects you need to define a method called __add__. For example, we have an integer variables x = 20, y = 10 and if we apply an arithmetic operator + (x + y) to perform an addition operator, then we will get the result as 30 like as shown below. Here, we are two TextBoxes and 4 operations to be performed: Addition, Subtraction, Multiplication and Division. The C# arithmetic operator performs the basic calculation as add, subtraction, multiplication, division, and modulus whereas other operators perform a different kind of task. My program uses the StringTokenizer class to perform arithmetic operation, in this case addition, on String characters. Java program to multiply N numbers without using * operator Write a Java program to multiply N numbers without using * multiplication operator. Assigning Literal that is too large for a variable. 0—there is some confusion in this area) on par with even the most powerful object-oriented languages. They are 1. operation::= One of a set of functions with special syntax and semantics that can be used to construct an expression. Three types of method overloading. Ive got it most of the way done accept when I use the + operator the program crashes. In order to explain the concept we have create two classes Loan and PersonalLoan. Description of program: In this section we will get the arithmetic values. The Java object provides a mechanism that is similar to the Java Native Interface (JNI) for instantiating Java classes and accessing fields and methods on the resultant objects. Arithmetic operation on complex numbers using function overloading Program Description The program demonstrates the implementation of complex number class and performs simple arithmetic operation using operator overloading. Let’s look at each type of operator in details with examples. When the Java program java Argument1 is executed, the Java system first pass the command line arguments (a, b and c) to the main method.