Skip to content

OctalToBinary strange method declarations #157

@TheFern2

Description

@TheFern2

This class has a very strange method. It is passing a parameter and not even being used.
On top of that there are two methods called within that method.

public static int convertOctalToBinary(int o) {
		Scanner scan;
		int num;
	
		void getVal() {
		
			System.out.println("Octal to Binary");
			scan = new Scanner(System.in);
			// Entering the needed number
			System.out.println("\nEnter the number : ");
			num = Integer.parseInt(scan.nextLine(), 8);
		}
		
		void convert() {
		
			String binary = Integer.toBinaryString(num);		
			System.out.println("Binary Value is : " + binary);
		}
	}

OctalToBinary.java

Please assign this to me. I'll get it fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions