Most voted "scanner" questions
49 questions
Sort by count of
-
20
votes2
answers1978
viewsHow to use the Java scanner
I was doing an exercise for the university using the class Scanner and something unusual happened, watch the code. for(int i = 0; i < 11; i ++){ //problema(esta pulando a escolha de um dos…
-
16
votes3
answers2012
viewsWhy does Scanner return error on something that is within the expected?
Note that I have typed a number, a text and a number, as you ask there. import java.util.Scanner; class Ideone { public static void main (String[] args) { Scanner entrada = new Scanner(System.in);…
-
11
votes3
answers2753
viewsSolution to scan documents by browser
I want users to digitalizem documentos straight from browser and then up to server. I found APIS who do this but all get paid and the licenses dearest ! Can someone present a solution ? Even if the…
-
6
votes4
answers1206
viewsJava Class Scanner Loop Error
When using the nextLine() method instead of next() in the code below, code interactions are skipped and some fields are empty. import java.util.Scanner; public class turma { public static void main…
-
4
votes2
answers2516
viewsWhat are the differences between Inputstreamreader and Java Scanner
I was aware of the data reading by Scanner, know superficially its functioning, however I came across some examples using a class called InputStreamReader for data reading. What are the differences…
-
3
votes2
answers331
viewsCheck string value
I wanted you to check if the entered value is vegetarian, and if it is, print on the user’s screen is vegetarian as follows the code, but when I type vegetarians or anything else it warns that it is…
-
3
votes1
answer373
viewsGet image of only one sector in a scanner (python)
Good afternoon! I need to develop a python application and I’m not getting the program to get an image of a scanner sector, only of the entire area that the scanner can scan (approximately a A4…
-
3
votes1
answer424
viewsRun Java class by passing parameters to Scanner
Bestamos creating a programming championship in Java and we would like the students to make an algorithm that reads from a scanner and calculates a certain mathematical logic and returns in the…
-
3
votes2
answers67
viewsnextInt() after the third integer
Given the example.csv: nome;idade;10;21;32;43;54 I can use the class Scanner to read such a file. Using the method .useDelimiter() and taking advantage of the ; to pick up each value. So I use the…
-
3
votes2
answers106
viewsInfinite Loop when reading Scanner values
My goal is to deposit in several notes (10, 20, 50 and 100). For this, in the method main left so: static Scanner lerInfo = new Scanner(System.in); public static void main(String[] args) { int nOpc…
-
3
votes1
answer1739
viewsError using scanner.close()
I’m trying to run this code in Java, using Eclipse. The same runs once normal. When trying to repeat the operation (choosing option 1) gives error as shown below. If I remove the scanner.close(); it…
-
3
votes2
answers2455
viewsBuild error: "Resource Leak" when using Scanner
I’m solving a question from Deitel’s book question 3.17, but I have a problem in the main class (I’m doing it for Eclipse, in the Linux environment). The code is like this: public class…
-
2
votes1
answer382
viewsDelphi Integrator + Scanner
Does anyone know any component or way to integrate an application made in Delphi XE2 + Scanner, need to save what is being scanned.
-
2
votes2
answers71
viewsProblem with user inputs
I have the following code: public class FlagApplication { private Scanner keyboard; .... private void insertNewRegistry(){ System.out.println("insira os dados de pessoa: nome, peso, altura, idade,…
-
2
votes0
answers38
viewsVector fill problem with typed text reading
I’m doing a little job, which consists in registering teams and matches of a football championship. When compiling and executing the code, it works, but in the part where I will register, it jumps…
-
2
votes0
answers1870
viewsBarcode scanner for browser
The scenario is as follows: I’m creating an application in Ionic 2, but I need it to also be accessed through a URL in a browser, like Chrome. One of the requirements of this application is that it…
-
2
votes3
answers159
viewsScanner gives error if inverting the order in which data is read
When I put to read first the int and then the chain of string, the system works smoothly, but when I invert it gives an error and does not finish. import java.util.Scanner; class main { public…
-
1
votes2
answers449
viewsBarcode Scanner for iOS, Android and Windows Phone (Phonegap)
Good morning, I’ve been looking for months for a plugin or function that allows me to scan a barcode through my app developed in Phonegap for iOS, Android and Windows Phone. Does anyone know of a…
-
1
votes1
answer51
viewsScanner isn’t picking up all the lines
I have a file with 7 million lines, but my code takes at most 63000 and returns no error. Scanner sc2 = null; try { sc2 = new Scanner(new File("./assets/words.txt")); } catch (FileNotFoundException…
-
1
votes2
answers362
viewsIs it possible to store user inputs by the Scanner Class in a database?
I have an application made in Java, and I need to store the user’s registration information in the database: Cpf, password, name, address, telephone System.out.println("Digite seu CPF"); cpf =…
-
1
votes1
answer1673
viewsScanner.nextLine does not pick up information after Scanner.nextInt
I’m having trouble with this code, I’m starting in programming, this is just an activity for practice. I do not understand why when executing the code the field 'Campus' does not allow the entry of…
-
1
votes2
answers74
viewsSkip file when entering an Exception
Good afternoon Below is a method I use to read certain files from a folder. The problem is as follows. If the folder has 50 files (or 60, or 70, or 80 ...) and the method is reading a "faulty" file…
-
1
votes1
answer343
viewsCollecting links in a text file
I have a problem in my program where I have to get links in the entire text file. I used regex to collect the links, however, only a few lines are captured (the file has approximately 3500 lines)…
-
1
votes2
answers5200
viewsNosuchelementexception error when capturing data input with Scanner
I’m having problems with data inputs using Scanner with Joptionpane works well. Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Unknown Source) at…
-
1
votes1
answer548
viewsReading File in Java
I’m trying to read a file (arquivo.txt) which is in the same folder as my class, but I run the code an error appears that did not find the file. Could someone check what’s wrong? I thank you in…
-
1
votes2
answers1511
viewsReading data from a Java file
Good evening, I have a text file like the image I need to read this file and take the data and store it in an object array. For example, I have a ROOM object, this object has the following…
-
1
votes0
answers297
viewsHow to find out which services are running on a python port?
I would like to add my question to that code: #!/usr/bin python3 # coding: utf-8 import argparse import socket import os import sys def Logo(): print (''' ______ ____ __________ ___ / / /_ \/ /__…
-
1
votes0
answers77
viewsDeveloping application to communicate with Scanner using Windows image Acquisition (WIA)
I’m trying to develop an application that communicates with a scanner. In my research, I found in the Microsoft documentation a Service called Windows image Acquisition that allows this…
-
1
votes1
answer1484
viewsHow to read a float with Scanner
My problem is this: package com.vreawillsaveyou01; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); float number =…
-
1
votes2
answers188
viewsCalculator in Java
Everything was going well until the part where the result should appear. public static void main( String[] args) { Scanner in = new Scanner(System.in); int num1,num2,resul; String sinal;…
-
1
votes0
answers29
viewsScan Wi-Fi network on Android
I’m trying to scan all Wi-Fi networks that the phone normally takes. My intention of this scan is to select and connect the desired network. I even followed Andriod’s own tutorial Wifi-Scan. But the…
-
1
votes1
answer61
viewsHow do I check if my input is number or text?
I wonder how I can check the kind of value that goes into my Scanner, to return to the user that that entry only receives a number and that he has typed a text or character. public class…
-
0
votes2
answers186
viewsMake variable wait to be set by user after While? java
Hello, I want the user to set the value of a variable, but it should set it only after the while. My question is, how do you do it? Here’s the piece I’m doubting. public static void…
-
0
votes2
answers922
views -
0
votes1
answer85
viewsProblem reading strings and numbers in sequence with Scanner
I came across this problem in the code at the time the program will read the second name and the second name note, ie the name of the second student and his grade. Can you explain to me what…
-
0
votes1
answer22
viewsHow to use Scanner to define the characteristics of the "product" object
public static void cadastrarProduto(String nome, int codigo, int quantidade, double valor) { var produto = new Produto(); Scanner leitor = new Scanner(System.in); nome = leitor.next(); produto.nome…
-
0
votes1
answer252
viewsCreate more than one variable using the scanner command
I did a search by google but could not get an answer that illuminated my head, I’m starting to study java and I came across the following problem: Create a Java program that reads from the keyboard…
-
0
votes2
answers493
viewsError Converting String to Numbers in Java
In my last post (do/while repeats the expression twice) was having an input overlay problem using the Scanner class, and according to the links placed in the answer, we cannot use nextLine() after…
-
0
votes0
answers244
viewsJava build error (Eclipse) using Scanner class, beginner problem
I’m starting to study Java now for the book "Java How to Program 10 Edª" and I’m having trouble compiling this book code in Eclipse ( Follow the Error Image ). Follow the code below Could someone…
-
0
votes0
answers77
viewsJAVA-Correct way not to read enter key
I am making the problem 1168 - LED and would like to know if there is a way to make my in.nextLine() do not read the enter key,I managed creating a variable to read this enter,but I’m sure it is not…
-
0
votes1
answer61
viewsCircumference area
Good evening! I’m starting in Java, and I’m trying to complete the Circumference Area Code of the URI. You’re giving a lot of trouble: Exception in thread "main" java.util.Nosuchelementexception at…
-
0
votes0
answers154
viewsClear Fujitsu Fi-7160 buffer scanner in c#
I’m working on a Company project, C# Windows Form and I’m still a beginner on the dot net platform. I would like to know with friends by profession, if there is any way I can clean the buffer of the…
-
0
votes2
answers280
viewsInfinite loop when reading integers with Scanner
I’m trying to treat an exception within a repeating structure for, but I am having difficulties, because the catch is not returning to the for, and by typing an invalid value, it is in an infinite…
-
0
votes1
answer56
viewsWhen a validation is negative I would like the program to return, so I can enter the data again
I have a switch that validates 5 cases, but already in the first if you do not enter a number that is not among 5 of mine case, it shows that the option is incorrect and closes. I wish the program…
-
0
votes1
answer150
viewsHow to make the Java Scanner read more than once in a program using classes?
I have to make a code using Object Oriented Programming, where you have a password already predefined and using Scanner you enter at least three attempts (one at a time). The program is reading only…
-
0
votes1
answer23
viewsJava skips my scanner and won’t let me answer!
I am learning Java alone. One of the activities was the following: "Make a program that works like a calculator between two numbers any choice to calculate the sum, subtraction, division or…
-
-1
votes1
answer81
viewsRead objects through the Scanner class
[![PHOTO OF THE CODE][1]][1] I am not able to instantiate an object and read it with the method of the Scanner class. It is possible to do something like? Scanner s = new Scanner (System.in); Notas…
-
-1
votes1
answer77
viewsfile reading with scanner
I would love to know if anyone can help me with this code below, in my application the user will often upload some files and they have two information, number and name separated by -> ; but in…
-
-3
votes2
answers36
viewsExercise with ongoing scanner, does not perform correctly
I’m studying in a game development course using Java, in one of the classes is proposed an exercise using scanner,but when trying to execute the code does not execute correctly. the code in question…