Skip to content

iffomko/string_java_6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STRING (BEFORE JAVA 7)

I practiced implementing strings, which uses in versions before java 7. This method of implementing strings is the most time-efficient, but takes up more memory. More time-efficient achieved by immutable classes (design-pattern).

Methods in this class:

  • constructor MyString gets in arguments "strings" or variable with type of string and initialize values of object
  • method .setStr() gets in argiments "strings" or variable with type of strings and initialize values of object
  • method .println() print string on screen with a transfer to another line
  • method .print() print string on screen without a transfer to another line
  • method .length() returns a length of string
  • method .substr(), which gets in first argument begin position and the second argument final position, returns object with type of MyString which contains substring value
  • method .append(), which gets in arguments "string" or variable with type of String, insert new string from the arguments in end of value of string in this object
  • method .prepend(), which gets in arguments "string" or variable with type of String, insert new string from the arguments in begin of value of string in this object
  • method .charAt(), which gets in arguments index of symbol, returns symbol by this position

About

I practiced implementing strings before java 7. This method of implementing strings is the most time-efficient, but takes up more memory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages