“int cannot be dereferenced” in Java

id is of primitive type int and not an Object. You cannot call methods on a primitive as you are doing here : id.equals Try replacing this: if (id.equals(list[pos].getItemNumber())){ //Getting error on “equals” with if (id == list[pos].getItemNumber()){ //Getting error on “equals”

Java program to find a pallindrome [closed]

boolean isPalindrome(String input) { for (int i=0; i < input.length() / 2; ++i) { if (input.charAt(i) != input.charAt(input.length() – i – 1)) { return false; } } return true; } This solution is self explanatory, the only edge case requiring explanation is what happens for words with an odd number of letters. For an input … Read more

Does BlueJ not require a main() method? [closed]

BlueJ is a development environment which is a deliberately smaller and simpler interface than professional environments like NetBeans or Eclipse. This allows beginners to get started more quickly and hence doesnt force you to write the main() instead it does it for you in the background https://www.cs.utexas.edu/users/scottm/cs307/handouts/BlueJProjectInstructions.html Where as Netbeans and Eclipse mandate that you … Read more