Giter Site home page Giter Site logo

java-basic's Introduction

Java Basic Dev Log

Day 3

Problems

  1. From Bing: Write a Java program that reads an integer between 0 and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all its digits is 14.
  2. From PoE: Write a program that takes a string as input and checks if the string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward.

What I learn

  • Remind me from using maven to build source code
  • To run a main function of a class java -classpath .\target\classes\ dev.ducminhgd.numeric.Sum.

Day 2

Problems

From PoE:

  • List of Fibonacci number to N.
  • Count vowels in a string

What I learn

  • Remind me of recursive function.
  • java.util.List is an interface, so you cannot use List<Integer> l = new List<Integer>();. Use new ArrayList<Integer>() instead.
  • java.util.Array is a fixed size type, all elements must be the same type. Data is located on continuous memory zone.
  • java.util.ArrayList is a dynamic size type. It can contain both primitive type or Object type. If T is an Object Type, ArrayList can contain T's inheritances.
  • Integer is a wrapper class of int, and provides methods that working with that int value.
    • Default value of an int variable is 0, and default value of Integer is null.
    • Integer can be contained in a Java Collection type, but int.
  • Use "aeiou".indexOf(c)!=-1 to check if c is one of the five vowels or not.

Day 1

  • Review syntax with Sum.SumToN, Sum.SumOddToN , and Sum.SumEvenToN.
  • Remind me of inputting from Console.

java-basic's People

Contributors

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