/JAVA

Primary LanguageJava

Exercise/Memo

This Folder is where I store all my JAVA coding memo! The chapters below is contents of what I covered and examples of the code!

=========================================================

How to run .java file (for mac) in commandline:

-Open terminal and type in command

  1. COMPILE JAVA $ javac (filename).java
  2. write the classname you set in the java file $ java (classname)

========================================================= /Practice/...

Main1.java

  • how to make a table through java.
  • ESCAPE SEQUENCES
  • printing out text and numbers
  • using backslashes \

Main2.java

  • using integers
  • using float
  • calculating average numbers inputted
  • scanning inputted numbers

Main3.java

  • Stringbuilder class
  • .append()
  • .length()
  • the num of chars in a string
  • for loop

Main4.java

  • if else statement
  • equalsIgnoreCase
  • indexOf();
  • substring

Main5.java

  • setting locale
  • NumberFormat
  • getCurrencyInstance

Main6.java

  • Date()
  • getTime()
  • getDateInstance()
  • LocalDateTime.now()
  • LocalDate.of()
  • GregorianCalendar()

Main7.java

  • parsing string to double value
  • using IOException
  • parseDouble

Main8.java

  • using IOException
  • reading files(scan)
  • scanning strings
  • .hasNext();
  • .nextLine() vs .next() vs .nextInt();
  • .charAt();
  • .toCharArray();

=========================================================

/Practice/projects/... (I used IntelliJ to edit these files)

class PROJECT1

  • plaing with Strings, Boolean and chars array

class PROJECT2

  • reversing words and sentences

class PROJECT3

  • Playing rock, scissors and paper with computer
  • using random, while loop, if else, do while etc...

class PROJECT4

  • calculating a salary raise
  • using number format, if else statement

class PROJECT5

  • playing with Strings
  • toUppercase, concatinating, replacing

class PROJECT6

  • plaing with primitive data types
  • byte, short, int, long, float, double

class PROJECT7

  • playing with char and Boolean

class PROJECT8

  • testing while loop to calculate numbers