Giter Site home page Giter Site logo

calculator-java's Introduction

Calculator-java

Simple calculator program using java . class is created by the name 'Calci'.

Java Classes/Objects

Java is an object-oriented programming language.

Everything in Java is associated with classes and objects, along with its attributes and methods. For example: in real life, a car is an object. The car has attributes, such as weight and color, and methods, such as drive and brake.

A Class is like an object constructor, or a "blueprint" for creating objects.

ActionListener

ActionListener interface is used.

  • Here, the crucial and integral part is an object that can implement the Action Listener interface. This object must be identified by the program as an action listener on the button that is nothing but the event source.

  • Thus, utilizing the addActionListener method, when the user clicks the button it fires an action event. This invokes the action listener’s actionPerformed method. Please note that it is the only method in the ActionListener interface. A single argument to the method is an ActionEvent object, which provides information on event and its source.

button.addActionListener(this)

It means the component button will be included in the components which are being tracked for an action event. It is mandatory to add a component to an action listener in order for you to add codes when the user clicks that particular component. Components that are not added with an action listener will fail to be monitored.

calculator-java's People

Contributors

anjalipathak03 avatar

Stargazers

Siddhi Patade avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.