Click here to Skip to main content
15,943,148 members
Home / Discussions / Java
   

Java

 
QuestionConnect morpho biometric device with jav Pin
Member 156609363-Jun-22 3:10
Member 156609363-Jun-22 3:10 
AnswerRe: Connect morpho biometric device with jav Pin
Richard MacCutchan3-Jun-22 9:06
mveRichard MacCutchan3-Jun-22 9:06 
Questionissue starting my ksql-server Pin
james michael May202225-May-22 13:20
james michael May202225-May-22 13:20 
AnswerRe: issue starting my ksql-server Pin
Richard MacCutchan25-May-22 22:03
mveRichard MacCutchan25-May-22 22:03 
QuestionHash Table implementation Pin
Member 156289598-May-22 18:52
Member 156289598-May-22 18:52 
AnswerRe: Hash Table implementation Pin
Richard Deeming8-May-22 21:27
mveRichard Deeming8-May-22 21:27 
AnswerRe: Hash Table implementation Pin
Richard MacCutchan8-May-22 21:43
mveRichard MacCutchan8-May-22 21:43 
QuestionHi guys my code is not compiling as its showing cannot find symbol please help Pin
Member 1561125322-Apr-22 4:48
Member 1561125322-Apr-22 4:48 
package classes;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

public class Inventory {

    private ArrayList <Item> listItems;

    public Inventory() {
        listItems = new ArrayList<Item>();
        readInventory();
    }

    public void showInventory() {
        for (int i = 0; i < listItems.size(); i++) {
            System.out.println(i + 1 + ". " + listItems.get(i).getName());
        }
    }

    public Item getItem(int index) {
        if (index <= listItems.size()) {
            return listItems.get(index);
        }
        return null;
    }

    public int inventorySize() {
        return listItems.size();
    }

    private void readInventory() {
        try {
            File myObj = new File("data/inventory.txt");
            Scanner myReader = new Scanner(myObj);
            while (myReader.hasNextLine()) {
                String line = myReader.nextLine();
                String[] data = line.split(",");
                String name = data[0];
                double price = Double.parseDouble(data[1]);
                Item item = new Item(name, price);
                listItems.add(item);
            }
            myReader.close();
        } catch (FileNotFoundException e) {
            System.out.println("An error occurred. The inventory file not found.");

        }
    }

}

AnswerRe: Hi guys my code is not compiling as its showing cannot find symbol please help Pin
Dave Kreskowiak22-Apr-22 4:53
mveDave Kreskowiak22-Apr-22 4:53 
AnswerRe: Hi guys my code is not compiling as its showing cannot find symbol please help Pin
zemiak1231-May-22 13:06
zemiak1231-May-22 13:06 
QuestionDevelopment of Wiki functionality in JSF project Pin
Dev Learning22-Apr-22 2:25
Dev Learning22-Apr-22 2:25 
QuestionRelated to resolve my error(Rearranging an array) Pin
Prateek Bajpai10-Apr-22 4:49
Prateek Bajpai10-Apr-22 4:49 
AnswerRe: Related to resolve my error(Rearranging an array) Pin
Richard MacCutchan10-Apr-22 5:53
mveRichard MacCutchan10-Apr-22 5:53 
QuestionHOW TO USE JTABLE TO DISPLAY ALL RECORDS DATA FROM DATABASE USING JDBC Pin
Member 1558267928-Mar-22 21:48
Member 1558267928-Mar-22 21:48 
AnswerRe: HOW TO USE JTABLE TO DISPLAY ALL RECORDS DATA FROM DATABASE USING JDBC Pin
Richard MacCutchan29-Mar-22 1:31
mveRichard MacCutchan29-Mar-22 1:31 
GeneralRe: HOW TO USE JTABLE TO DISPLAY ALL RECORDS DATA FROM DATABASE USING JDBC Pin
Member 155826795-Apr-22 21:49
Member 155826795-Apr-22 21:49 
QuestionWhiteSpace Character Pin
Sudhanshu_India5-Mar-22 23:26
Sudhanshu_India5-Mar-22 23:26 
AnswerRe: WhiteSpace Character Pin
Richard MacCutchan6-Mar-22 1:22
mveRichard MacCutchan6-Mar-22 1:22 
GeneralRe: WhiteSpace Character Pin
Sudhanshu_India7-Mar-22 15:04
Sudhanshu_India7-Mar-22 15:04 
GeneralRe: WhiteSpace Character Pin
Victor Nijegorodov7-Mar-22 20:12
Victor Nijegorodov7-Mar-22 20:12 
GeneralRe: WhiteSpace Character Pin
Richard MacCutchan7-Mar-22 21:16
mveRichard MacCutchan7-Mar-22 21:16 
GeneralRe: WhiteSpace Character Pin
Sudhanshu_India8-Mar-22 3:45
Sudhanshu_India8-Mar-22 3:45 
GeneralRe: WhiteSpace Character Pin
Dave Kreskowiak8-Mar-22 4:47
mveDave Kreskowiak8-Mar-22 4:47 
GeneralRe: WhiteSpace Character Pin
Sudhanshu_India8-Mar-22 14:54
Sudhanshu_India8-Mar-22 14:54 
GeneralRe: WhiteSpace Character Pin
Victor Nijegorodov8-Mar-22 4:55
Victor Nijegorodov8-Mar-22 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.