I am new to java programming. So, while practicing some java programming. I got a very strange logical error.

Does'nt matter what the user enters, the programm always returs the result as true.
Please, tell where I am stuck:

I will be positing my code here:

import java.util.Random;
import java.util.Scanner;

public class Tanmay {

    public static void main(String... asd) {
        int b = 0;
        Random randomGenerator = new Random();
        int a = randomGenerator.nextInt(10);
        network n = new network();

        Scanner d = new Scanner(System.in);

        int c;
        System.out.print("\nplease enter your guess!\n");
        c = d.nextInt();
        System.out.print(c + "\n");


//the network class:

public class network {

    private int input=0;
    private int checker=1;
public boolean again = false;

    public void setter(int a) {
        input = a;

    public void getter(int a) {
        checker = a;

public void checker(){
System.out.println("its true ");
        System.out.println("its false");



I know, they are many unused variables. Actually when the program was not working. I tried to check the errors, by making the code more simple. That is why I have so many unused variables.

please help out the noob, with this problem..

THank you in advance.

This article has been dead for over six months. Start a new discussion instead.