Java code help

Java

Page 1 of 1

5 Replies - 12171 Views - Last Post: 22 October 2010 - 08:24 PM Rate Topic: -----

#1 Guest_Mangala Jois*


Reputation:

Java code help

Posted 22 October 2010 - 02:37 AM

import java.io.*;
class cond
  {
  	int a,b;
  	InputStreamReader I = new InputStreamReader (System.in);
  	BufferedReader br = new BufferedReader(I);
  	Void Accept()throws IOException
  	  {
  	  	System.out.println("Enter 2 numbers");
  	  	a=Integer.parseInt(br.readLine());
  	  	b=Integer.parseInt(br.readLine());
  	  }
    Void Condition()
      {
      	if(a==B)/>
      	  System.out.println("They are equal--dono ek hi hai yaar!");
      	if(b<a)
      	  System.out.println("A is greater than B--A, B se adhik hai");
      	if(a<B)/>
      	  System.out.println(a+"is greater than"+B)/>;
      }
    public static void main(String args[]) throws IOException
      {
      	cond C = new cond();
      	C.Accept();
      	C.Condition();
      }
  }


MOD EDIT: When posting code...USE CODE TAGS!!:

:code:

Is This A Good Question/Topic? 0

Replies To: Java code help

#2 Dean_Grobler  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 390
  • Joined: 15-January 10

Re: Java code help

Posted 22 October 2010 - 02:51 AM

What do you need help with? What error's or whatever are you getting..etc?
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6245
  • View blog
  • Posts: 24,013
  • Joined: 23-August 08

Re: Java code help

Posted 22 October 2010 - 03:34 AM

Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
  • Post the code you're having problems with
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

Was This Post Helpful? 0
  • +
  • -

#4 TokoYami200  Icon User is offline

  • New D.I.C Head

Reputation: 13
  • View blog
  • Posts: 44
  • Joined: 18-October 10

Re: Java code help

Posted 22 October 2010 - 11:17 AM

Java is case sensitive; i.e. a is not the same as A.

In your code you should make sure all of your variables match such as in lines 15, 19 and 20 where it uses B as a variable when it should be b. Finally, it's void (lowercase) not Void.

It should work then, didn't check it though. :P
Was This Post Helpful? 0
  • +
  • -

#5 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon

Reputation: 2965
  • View blog
  • Posts: 11,222
  • Joined: 15-July 08

Re: Java code help

Posted 22 October 2010 - 04:04 PM

The b was probably posted correctly. The forum software has a known bug where if ther is a lowercase b followed by a ')', then it automatically capitalizes it. Although, the Void is probably the source of the problem
Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8378
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Java code help

Posted 22 October 2010 - 08:24 PM

Topic closed.

First it does not respect rule #4 of the forum Give your topic a descriptive title, NOT "Help" or "Plz Help Me" or "I'm a noob"

Second, even if the topic title is completly useless, there is no question asked it the topic itself.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1