Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Compilation Error: Exception in thread "main" java.lang.VerifyError:
    primarykey
    data
    text
    <p>I'm getting this error when i run my code not sure what is wrong here:</p> <pre><code>Exception in thread "main" java.lang.VerifyError: (class: first3weeks/Main, method: &lt;init&gt; signature: ()V) Constructor must call super() or this() Java Result: 1 </code></pre> <p>Student Code:</p> <pre><code>package first3weeks; public class Student { private String name, id; private int[] score = new int[3]; public Student(){} public Student(String stName, String stID, int stScore[]){ name = stName; id = stID; score = stScore; } public void setName(String nameIn){ name = nameIn; } public void setID(String idIn){ id = idIn; } public void setScore(int scoreIn[]){ score = scoreIn; } public String getName(){ return name; } public String getID(){ return id; } public int[] getScore(){ return score; } public double avScore(){ double total = score[1] + score[2] + score[3]; return (total/3); } public void printOut(){ System.out.println("Student Name: " + getName() + "\n" + "Student ID: " + getID() + "\n" + "Student Average: " + avScore()); } } </code></pre> <p>Main Class:</p> <pre><code>package first3weeks; public class Main { public static void main(String[] args) { int[] score1 = {12,15,19}; int[] score2 = {32,65,29}; Student stud1 = new Student("Rob", "001", score1); Student stud2 = new Student("Jeff", "002", score2); stud1.printOut(); stud2.printOut(); Student stud3 = new Student(); int[] score3 = {56,18,3}; stud3.setName("Richard"); stud3.setID("003"); stud3.setScore(score3); stud3.printOut(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload