Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: please help java noob here

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default please help java noob here

    hey guys new to the forum and java. I am taking a java class and can seem to figure out how to fix this error below is my code any help is appreciated. i have to imput a binary number and have the decimal, ascii and result of decimal subtracted from 256 on 3 separate lines

    import java.util.Scanner;
    import java.lang.Integer;
    public class Binary {
    public static void main(String[] args) {
     
    Scanner in = new Scanner (System.in);
     
    // enter binary
    int b = in.nextint();
     
    // convert to decimal
    int decimalValue = Integer.parseInt(b, 2);
     
    // output decimal
    System.out.println(decimalValue);
     
    // add ascii output
     
    //add subtraction output
     
    	}
    }

    i keep getting the following when i try to compile

    Binary.java:8: cannot find symbol
    symbol : method nextmethod()
    location: class java.util.Scanner
    int b = in.nextmethod();
    ^
    Binary.java:10: cannot find symbol
    symbol : method parseInt(double,int)
    location: class java.lang.Integer
    int decimalValue = Integer.parseInt(b, 2);
    ^
    2 errors

    any help is appreciated thank you and i look forward to a response this is driving me nuts.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: please help java noob here

    cannot find symbol
    symbol : method nextmethod()
    The compiler can not find a definition for that method. Read the API doc for the class and find the correct name for the method that will do what you want.

    cannot find symbol
    symbol : method parseInt(double,int)
    The compiler can not find a parseInt() method that takes a double and int for its args. Read the API doc for that method and see what types of args it takes.

    The API doc link: Java Platform SE 7


    BTW The error messages did NOT come from the posted code. You need to post the code and its error messages. Don't post code for a different version of the program than the one where the error messages came from.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: please help java noob here

    thanks sorry about giving wrong error accidentally copied wrong test but was able to fix it using the api just didn't understand the cannot find symbol.

Similar Threads

  1. Java Noob needs help!
    By antares330 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 24th, 2012, 09:03 AM
  2. Help im a java noob!
    By jonathanfox in forum Collections and Generics
    Replies: 11
    Last Post: July 26th, 2012, 06:04 AM
  3. >>> Java Noob here <<<
    By Kikiam in forum Member Introductions
    Replies: 2
    Last Post: March 19th, 2012, 09:48 AM
  4. Please help! Noob java user here
    By New Guy_5 in forum Loops & Control Statements
    Replies: 3
    Last Post: November 14th, 2011, 09:44 PM
  5. Need Help with my hmwk! Java noob!
    By ravij in forum Loops & Control Statements
    Replies: 4
    Last Post: October 7th, 2009, 01:02 AM