+ 7
Please explain this class
Here is the token class. Please explain every line in detail hopefully hopefully it will solve my big trouble https://code.sololearn.com/c0IZmQSgmV1s/?ref=app
12 Réponses
+ 7
Every 81 lines of this code to be explained in details: are you kiding? :o
You'll be better adviced to make a google search about tokenization and code languages parsing and read many articles/ressources about, because this is a wide and deep topic... also, you should have a minimal Java (or other language if not) practice background to understand both the code itself and the principles ;)
+ 5
Denise Roßberg sure it will thank u😊
+ 4
Komal Ramzan
To explain every line would be a bit hard. ;)
But maybe this code helps you to understand the overriden methods:
https://code.sololearn.com/cK2H7CdVEq45/?ref=app
+ 4
Denise Roßberg i have knowledge about java n its basic concepts but my assignment is based on this class and i am using this type of class first time so there is confusion any ways i will search related topics on google☺
+ 3
visph of course i am not kidding🙄
+ 2
notice Token class override nothing
+ 2
zemiak
The class overrides equals(), hashCode() and toString().
Edit: I did not test the class so I am not sure if the implementations are correct.
+ 2
Komal Ramzan
The rest should be found in the java course.
You will need the lesson about enums.
The lesson about constructor:
public Classname() is a constructor for example:
public Token()
You have three. If I am correct there is only a lesson about method overloading but not constructor overloading. But it is similar.
Then you just need to read the lesson about methods.
+ 1
there are different ways how to create Token:
new Token(10.0); with number, as OPERAND, precedence 0
new Token("+"); with string, as OPERATOR, precedence 0(+-) or 2(*/)
new Token("("); with string, as PAREN, precedence -1
new Token(token1); with other token
- 5
hii
- 6
,e
- 6
Hi