saw your java tutorial and tries something, but having a problem

0 Aditya Jindal · September 6, 2015
package Bucky;

import java.util.Scanner;

public class apples111z {
public static void main (String args[]){
Scanner bucky = new Scanner (;
int boy, girl;
System.out.println("Enter the age of the boy ");
boy = bucky.nextInt();
System.out.println("Enter the age of the girl");
girl = bucky.nextInt();

if ( boy <= 18 && girl >= 60){
System.out.println("Not a suitable match");
System.out.println("you may make a match");



on entering the age of the boy as 10
and entering the age of the girl as 90
it is printing you may make a match, which is the else statement, whereas it should print the IF statement.

plz help.

P:S, thank you Bucky for all these videos.

Post a Reply


Oldest  Newest  Rating
0 rajeev man dongol · September 8, 2015
class name and file name must be same.
0 Alan Masimba Walker · September 7, 2015
I tried executing your code, and I didn't get an error.
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator