Code Monkey home page Code Monkey logo

java-programs's Introduction

Here are 3 programs that are focusing in Java's Object Oriented abilities, exceptions and File handling.

OOP Mini Project

That was my first Object Oriented Analysis project. It contains basic methods and attributes that are shown in UML image.

Calculator.java

This program calculates the mathematical expression: ((x-7)*y)/(x-2) Different types of exceptions are used to ensure the execution of the program even if (x==2) || (x is not a number) || (y is not a number)

Exer3.java

This program checks for a file named src.txt file and then reads its contents and adds a second newline after every newline. Also it replaces all blanks with the $ symbol. Finally it presents the src.txt file size, the newfile.txt and the number of blanks that were replaced by $s.

One interesting part in exercise 3 is the fact that the number of characters of the text file that is read dictates the size of the buffer and the file size of the newfile that the program creates. In that way it is ensured that there is no overflow and the program can be used for any file as input. It can be further modified so the text file name can be given as input and not be specific as src.txt.

java-programs's People

Contributors

aristidis13 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.