Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions

Justin is a student in it102 and they are now in the topic classes and objects. he learned how to create an objects and method. his problem now is he

doesn't know the operator he needs to use to have the objects access the method in his class. what operator should justin use?


If I understand the question correctly, you're asking how an object would use a method. Basically just use  <objectname>.<methodname>();"

For example:
public class Calculator(){
private int x = 4;
private int y = 5;

public void add(){

In your main method, you would instantiate Calculator  by saying

Calculator c = new Calculator();

and you could add by saying

0 0 0
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts