I was wondering if you’d be able to help me with some Java Programming problems.
ID: 3771251 • Letter: I
Question
I was wondering if you’d be able to help me with some Java Programming problems.
I attached the problem that I need your help. It is from the beginning class of Java Program
13. The following two classes together have 9 different compile-time (syntax) errors. Circle the parts of the code where 4 of them occur (do not circle more than 4, you do not need to find them all. For esch error that you circled, write a brief explanation of what the error is. i publ1c class W111NotConpile private Int yField-3; a2 public class A1sok111NotCompile s public static W111NotConpile(double initVal publ1c static void nain(String args) nyF1eld-th1s.1nitval; 111NotCompile ob1- new 111NotConpi1e(7) 1 public void getField) ob1.setF1eld(10): return ayFieid; int final W111NotCompile.getFieldO5; us public static int setField(1nt neVal) Systen.out.println(11nal) this.nyF1eld neuValExplanation / Answer
1.myfield=this.initval; is wrong
it would be written like this.myfield=initval;
2. void type of method can not return any value
return myfield; is wrong
3.int type method must return value.
public static int setfield(int newval)
{
this.myfield=newval;
}
this metod must have a return command
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.