@fredyeboah Please Edit your post and wrap your code with
<YOUR CODE HERE>
to get highlighting and preserve formatting.
Type: Posts; User: Norm
@fredyeboah Please Edit your post and wrap your code with
<YOUR CODE HERE>
to get highlighting and preserve formatting.
That is from:
System.out.println(j);
It's what is returned from the default toString() method for a class. j is the class reference that was printed.
The a$b is the name of the class. It says...
Have you got it working now?
Make the class b static by adding static before the word class:
static class b {
Please copy the exact text of the error message. I do no understand the error message you posted.
Please copy full text of error message and paste it here. Here is a sample:
...
That looks like you can create an instance of the b class.
Now try calling the b class's max() method using that new object (j) that the code creates.
On Windows: To copy the contents of the...
Where does the code try to create a new instance of the b class?
Take a look at the tutorial for some examples:
Lesson: Object-Oriented Programming Concepts (The Java™ Tutorials > Learning the...
Try doing the first step: create an instance of the b class.
You will need that to be able to call any methods in the b class.
When you get errors you need to copy and paste the full text...
Sorry, the idea is for you to write the code and to ask us questions when you have a problem.
Which part(s) are you having problems with?
1) create instance of the b class
2)calling the max()...
Is the second line you want for output from the println statement in the b class's max() method?
To execute the max() method you need to
1)create an instance of the b class
and use that to ...
What would a "printout of class b" look like? What does your code print now?
Post the program's output and explain what is wrong with it and show what you want the output to look like.