Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,305 members, 7,811,900 topics. Date: Sunday, 28 April 2024 at 10:49 PM

Help On Java - Programming (4) - Nairaland

Nairaland Forum / Science/Technology / Programming / Help On Java (9565 Views)

Pls Help Me With Ebooks On Java,d Price For The Book Is High And Am Still A Teen / Anyone With Help On Java App Creation? / [Help Request] Help On Java download and Installation Oo! (2) (3) (4)

(1) (2) (3) (4) (5) (Reply) (Go Down)

Re: Help On Java by candylips(m): 2:45pm On May 02, 2011
where is segsalerty he has a better understanding of the code. let him come and solve d problem
Re: Help On Java by 2muchlogic(m): 3:14pm On May 02, 2011
Dolemite:

2much what do you suggest I do?

Have you solved it yet? post your attempt here and let me see wink wink wink wink wink
Re: Help On Java by Dolemite(f): 3:23pm On May 02, 2011
2muchlogic:

Have you solved it yet? post your attempt here and let me see  wink wink wink wink wink

Yes i solved it. . .
   public void removePass(String nameIn) {
Iterator<Passengers> i = p.iterator();
        while(i.hasNext()) {
            if (i.next().getName().equals(nameIn)) {
                i.remove();
break;
                System.out.println(nameIn + "has been removed"wink;
            }
        }
    }
Now I need to implement a searchPassenger method. . .any ideas?
Re: Help On Java by 2muchlogic(m): 3:58pm On May 02, 2011
Dolemite:


public void removePass(String nameIn) {
   Iterator<Passengers> i = p.iterator();
        while(i.hasNext()) {
            if (i.next().getName().equals(nameIn)) {
                i.remove();
      break;
                System.out.println(nameIn + "has been removed"wink;
            }
        }
    }

Dolemite:

Yes i solved it. . .Now I need to implement a searchPassenger method. . .any ideas?

Well done, I solved it differently by using the passengerID, for example what happens when 2 or more passengers are called Ms Dolemite?  grin You have already done the searchPassenger method becuause you had to search for the passenger before you removed it - hence modifying your solution:

public Passenger searchPassenger(String nameIn) {
Passenger pFound;
   Iterator<Passengers> i = p.iterator();
        while(i.hasNext()) {
            if (i.next().getName().equals(nameIn)) {
                i.remove();
                   System.out.println(nameIn + "has been found"wink;
                pFound = i.next();
                break;
             
            }
        }
       return pFound;
    }

And do not forget to say thank you next time smiley wink cheesy grin grin
Re: Help On Java by Dolemite(f): 4:22pm On May 02, 2011
thank youuuuuuuuuu, please stay around, this saga is far from over. . .
Re: Help On Java by segsalerty(m): 10:00pm On May 02, 2011
Wow, this post is so interesting !
I started seeing HasMap , CoalMap solutions lipsrsealed , blah blah blah, ;DDatabase solutions , Real heckical codes + algorithms. cheesy

Aal Izz well, Very Brilliant of u Dolemite for solving this , refering to what i provided u that refused to work for u sad

public void removePassanger(String nameOfPassanger){
int passangerIndexToRemove = 0;
for(Passangers p : pass){
if(p.getName().equals(nameOfPassanger){
pass.remove(passangerIndexToRemove);
}
else{
passangerIndexToRemove++;
}
}
}

which i doubt if it could refuse to if u actually implemented it well, well, Good to see u put urself in the run of finding another way of fixing urs in ur own coding style, shows u re really learning and this thread is actually helping ur Java skill, smiley smiley smiley smiley am so so happy for this, Keep it up !

@others,
Pls, dnt make problems too complex for whoever u wanna Help, they wanna learn from u. Try to solve it for them the simplest way, readable and understandable by a 2yrs old kid. This thing called programming is too simple and requires lil tacktics NOT bringing up WILD Algorithms. GBAM !

smiley smiley smiley smiley smiley smiley smiley
Re: Help On Java by 2muchlogic(m): 11:26am On May 03, 2011
Dolemite:

thank youuuuuuuuuu, please stay around, this saga is far from over. . .

you are welcome wink
Re: Help On Java by Dolemite(f): 3:44pm On May 03, 2011
Any ideas on how I could integrate the first two classes into a gui below?
public class Passenger
{
private String name;
private int fare;
private int weight;
private int luggage;
private int tpw;
private int totalTpw;

public Passenger(String nameIn, int fareIn, int weightIn, int luggageIn){
name=nameIn;
fare=fareIn;
weight=weightIn;
luggage=luggageIn;
}
public int setWeight(int weightIn){
weight=weightIn;
return weight;
}
public String getName(){
return name;
}
public int getFare(){
return fare;
}
public int getWeight(){
return weight;
}
public int getLuggage(){
return luggage;
}
public int setTpw(){
tpw=weight*luggage;
return tpw;
}
public String toString(){
return name + " " + fare + " " +weight+ " " +luggage;
}

}

public class Aircraft
{
private ArrayList<Passenger>pass=new ArrayList<Passenger>();
private int seats=250;
private final int WEIGHT= 21300;
private String name;
private int fare;
private int weight;
private int luggage;
private int tpw;
private int totalfares;
private Passenger p;


public void addPassenger(String nameIn,int fareIn, int weightIn, int luggageIn){
name=nameIn;
fare=fareIn;
weight=weightIn;
luggage=luggageIn;
p= new Passenger(name,fare,weight,luggage); //passenger object
tpw=weightIn+luggageIn; //calculates and adds the tpw
if(tpw>=50&&tpw<=100&&tpw<WEIGHT&&seats>0){
pass.add(p); //adds the passenger
fare=fareIn+((tpw-50)*5); //calculates the fare
totalfares=totalfares+fareIn;
System.out.println("You have just added"+nameIn);
System.out.println("Fare is"+fare);
seats--;
System.out.println(seats+"left"wink;
}else if(tpw>=100&&tpw<=150&&tpw<WEIGHT&&seats>0){
pass.add(p); //adds the passenger
fare=fare+((tpw-100)*10);
totalfares=totalfares+fareIn; //collects the total fares
System.out.println("You have just added"+nameIn);
System.out.println("Fare is" +fare);
seats--;
System.out.println(seats+"left"wink;//print out the name of the passanger u just added by getting its name u initialized
}
else {
System.out.println("Passenger cannot be added!!"wink;
}
}

public ArrayList<Passenger> getPassengers(){
System.out.println(pass);
return pass;
}
public int getTotalfares(){
System.out.println(totalfares);
return totalfares;
}
public void removePassenger(String nameIn){
Iterator<Passenger> i = pass.iterator();
while(i.hasNext()){
if(i.next().getName().equals(nameIn)){
i.remove();
totalfares=totalfares-fare;
System.out.println(nameIn+ "has been removed"wink;
}
}
}
public void searchPassenger(String nameIn){
Passenger pFound;
Iterator<Passenger> i = pass.iterator();
while(i.hasNext()){
if(i.next().getName().equals(nameIn)){
System.out.println(nameIn+ "is in the list"wink;
pFound=i.next();
break;

}
}
}
}

and Im trying to create a gui:

public class BookingGui extends JFrame
{
private JButton addButton = new JButton("Add Passenger"wink;
private JButton removeButton = new JButton("Remove Passenger"wink;
private JButton displayButton = new JButton("Display Passengers"wink;
private JButton fundsButton = new JButton ("Display Funds"wink;
private JTextField seatsField = new JTextField(4);
private JTextField nameField = new JTextField(15);
private JTextField fareField = new JTextField(15);
private JTextField weightField = new JTextField(15);
private JTextField luggageField = new JTextField(15);

public BookingGui(){
setLayout(new FlowLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle("Airline Booking System"wink;
setSize(550,450);
setLocation(400,100);
getContentPane().setBackground(Color.gray);
//creates a border style for the JButtons
BevelBorder raisedBevel = new BevelBorder(BevelBorder.RAISED);
//adding the components
add(seatsField);
seatsField.setBorder(new TitledBorder("Seats"wink);
//Buttons are added with background colors and borders set
add(addButton);
addButton.setBackground(Color.green);
addButton.setBorder(raisedBevel);
add(removeButton);
removeButton.setBackground(Color.green);
removeButton.setBorder(raisedBevel);
add(displayButton);
displayButton.setBackground(Color.green);
displayButton.setBorder(raisedBevel);
add(fundsButton);
fundsButton.setBackground(Color.green);
fundsButton.setBorder(raisedBevel);
add(nameField);
nameField.setBorder(new TitledBorder("Name"wink);
add(fareField);
fareField.setBorder(new TitledBorder("Fare"wink);
add(weightField);
weightField.setBorder(new TitledBorder("Weight"wink);
add(luggageField);
luggageField.setBorder(new TitledBorder("Luggage"wink);
setVisible(true);


}
}
Re: Help On Java by segsalerty(m): 4:12pm On May 03, 2011
U shldnt ve proble, doing this at all, Note; ur GUI wont render those components u added using add() funtion, Its either u call on getContentpane().add() or introduce a JPane to add() those conponents and use getContentPane().add(the JPanel) , Get that, To implement ur ongoing codes on GUI, all u nid is just intialize the Aircraft class , Then add actionListeners to ur buttons to call to the Aircraft's necessary function. Try this out urself, show smth new and i will definately help u with codes to do this in the simplest form, Just do ur own homework on working on the idea i gave u, u can do smth beta. Sit down, calm down and do it urself! Sorry for my short explanations, i am on mibile, let me see what u ve got before i logon my sys tonite.
Re: Help On Java by 2muchlogic(m): 5:10pm On May 03, 2011
Dolemite:

Any ideas on how I could integrate the first two classes into a gui below?
and Im trying to create a gui:


1. create an instance of each class by initializing them inside the BookingGui constructor

2. create a listener to handle events for each UI element http://download.oracle.com/javase/tutorial/uiswing/events/actionlistener.html
Re: Help On Java by Fayimora(m): 11:14pm On May 03, 2011
NO offence but seems to me like your using this thread to do your assignment or mini-project or whatever. There is something called the JAVA API. There is also something something called JAVA DOCUMENTATION. Lastly there is something called JAVA TUTORIALS.

Am not saying you don't work on your own but to be honest if you have taken time to look at these stuffs, you wont see yourself posting things like this. These are things you can learn generally there(java tutorials). You don't just learn by solving questions.Thats what makes you better but how do you learn? There is a BIG difference between learning and getting better. You learn to know something but practice to get better.

You have to go through the Official tutorials and books aswel. If you need any say so and I would make it available to you to download or if you are the type that prefer hard copy books. I can buy one for you here and send to you. Its not gonna cost me anything.

Going back to the subject, Also you need to read the documentation, not all at once but bit by bit until you finish it. Lastly, you have to get familiar with using API's.

There is a really big difference between a programmer and someone who knows how to write code. There is also a big difference between a Java programmer and a Programmer. Try to look at this over and over but what I have to tell you is that you really don't want to be someone who just knows how to write code nor do you want to be just a Java programmer

I just hope you see the GOOD in this post and nothing else.

Good Luck.
Re: Help On Java by Dolemite(f): 11:23pm On May 03, 2011
I AM using this to do my assignment. . .on a deadline and I have 2 more exams to prepare for? I do solve some problems, i don't just come in here begging for code, i came in here with my own code? which means i did my work? so chill bro. . .

. . .and how can i become a programmer if i don't know how to write code?
Re: Help On Java by segsalerty(m): 11:30pm On May 03, 2011
Fayimora:

NO offence but seems to me like your using this thread to do your assignment or mini-project or whatever. There is something called the JAVA API. There is also something something called JAVA DOCUMENTATION. Lastly there is something called JAVA TUTORIALS.

Am not saying you don't work on your own but to be honest if you have taken time to look at these stuffs, you wont see yourself posting things like this. These are things you can learn generally there(java tutorials). You don't just learn by solving questions.Thats what makes you better but how do you learn? There is a BIG difference between learning and getting better. You learn to know something but practice to get better.

You have to go through the Official tutorials and books aswel. If you need any say so and I would make it available to you to download or if you are the type that prefer hard copy books. I can buy one for you here and send to you. Its not gonna cost me anything.

Going back to the subject, Also you need to read the documentation, not all at once but bit by bit until you finish it. Lastly, you have to get familiar with using API's.

There is a really big difference between a programmer and someone who knows how to write code. There is also a big difference between a Java programmer and a Programmer. Try to look at this over and over but what I have to tell you is that you really don't want to be someone who just knows how to write code nor do you want to be just a Java programmer

I just hope you see the GOOD in this post and nothing else.

Good Luck.

U really make good sense here bro, But, considering the reason why we need to help her, we need to let her realise her duty also so that all will react together and be a better result in return for her ! She should try to understand ur point and think twice. She will do better! I trust her! kiss

Dolemite:

I AM using this to do my assignment. . .on a deadline and I have 2 more exams to prepare for? I do solve some problems, i don't just come in here begging for code, i came in here with my own code? which means i did my work? so chill bro. . .

. . .and how can i become a programmer if i don't know how to write code?

so, u are here , u didnt say anything to my response, u denied me abi ? angry cry Dont get mad at the guy. He is so much also trying to help. Just do whats necessary and Lets get back to the Brain work ! wink
Re: Help On Java by Fayimora(m): 11:31pm On May 03, 2011
I just knew you wouldn't understand my point. IF YOU HAD, You wont have to ask for stuffs like this.  C'mmon don't you think you are better than this? Asking how to implement 2 classes into a GUI. To be honest that question should come from someone dat programs because he/she has to. You should do you stuffs and i mean everything yourself. You shouldn't come here to learn new concepts. You should come here to learn new Algorithms, new ways of doing what you HAVE already done.

If you had read these documentations before hand, which I know you knew was available. You would be like the Almighty Segs you always want to answer your questions. In as much as I am a good programmer, I have met a few from this forum we shared IDEAS and realised new ways of doing things but NOT learning new concepts like GUI.

You need to understand my point here.

P.S: you male or female?
Re: Help On Java by Dolemite(f): 11:40pm On May 03, 2011
Ok, sometimes i ask questions even before looking at the question im trying to take the lazy way out so i can study. . .
Re: Help On Java by Fayimora(m): 2:06am On May 04, 2011
ur choice girl/guy,
Re: Help On Java by Dolemite(f): 2:32am On May 04, 2011
Both. . . grin
Re: Help On Java by csharpjava(m): 6:22am On May 04, 2011
Fayimora

Programming is one of the few professions where programmers are very selfish in helping those that are learning, with coding. I'm sure you cannot work in an agile environment, in which pair programming is a must (an XP development technique used by agile methodology) in this type of environment you are not allowed to hide your codes.

You start your programming career as a trainee and you are trained by advanced programmers, no amount of books you read can make you a very good programmer unless you see the way other programmers have written their codes.

This is not a forum for those doing their PHD, so you need to stop asking those asking for help here to go and read books, they won't come here if they can find all the answers they want in books.
Re: Help On Java by Olamilec(m): 8:01am On May 04, 2011
Hello Nairalander, i am a beginner in Java Programming and i like how you guys use to talk about this Java and MySql please can somebody recommend some books for me and maybe anywhere i can do the training which will not be too cost and they will base the student experience on project.
Re: Help On Java by Olamilec(m): 8:21am On May 04, 2011
@Fayimora: please i read your post and i will like you to help me get some different used java books and even a self teach cd rom, i will send you the neccessary money you may require to buy and to send it, please i must know this java by fire by force cos am dying to know how to develop application. I will love to read your positive reply.
Re: Help On Java by csharpjava(m): 12:01pm On May 04, 2011
Dolemite

These three classes should get you started just follow the way I have done it upto my comment "// This is where I have got to" in the AircraftGUI Class where all the GUI coding should take place. Create new JLabels and replace all the System.out.println with these JLabels. For the other methods just create new buttons, add addActionListener(this) to them and follow how I used the first button I named AddPassangerButton for the addPassenger method.


import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;


public class AircraftGUI extends JFrame implements ActionListener
{

    private ArrayList<Passenger>pass=new ArrayList<Passenger>();
    private int seats=250;
    private final int WEIGHT= 21300;
    private String name;
    private int fare;
    private int weight;
    private int luggage;
    private int tpw;
    private int totalfares;
    private Passenger p;
   
   
   
private JLabel nameInLabel = new JLabel("name"wink;
private JTextField nameInField = new JTextField(5);
private JLabel fareInLabel = new JLabel("fare"wink;
private JTextField fareInField = new JTextField(5);
private JLabel weightInLabel = new JLabel("weight"wink;
private JTextField weightInField = new JTextField(5);
private JLabel luggageInLabel = new JLabel("luggage"wink;
private JTextField luggageInField = new JTextField(5);
private JButton AddPassangerButton = new JButton("Add Passanger"wink;
private JTextArea displayArea = new JTextArea(2,20);

public Aircraft() // Constructor
{
setTitle("Aircraft GUI"wink;
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
setSize(240,500);
setLocation(300,300);

add(nameInLabel);
add(nameInField);
add(fareInLabel);
add(fareInField);
add(weightInLabel);
add(weightInField);
add(luggageInLabel);
add(luggageInField);
add(AddPassangerButton);
add(displayArea);

AddPassangerButton.addActionListener(this);
setVisible(true);
}

  public void actionPerformed(ActionEvent e)
{
String nameInEntered = nameInField.getText();
String fareInEntered = fareInField.getText();
String weightInEntered = weightInField.getText();
String luggageInEntered = luggageInField.getText();

int fare = Integer.parseInt(fareInEntered);
int weight = Integer.parseInt(weightInEntered);
int luggage = Integer.parseInt(luggageInEntered);

                                if(e.getSource() == AddPassangerButton) // Run addPassenger method
{
if(nameInEntered.length() == 0 || fareInEntered.length() ==0  || weightInEntered.length() == 0 || luggageInEntered.length() ==0)
{
displayArea.setText("name, fare, weight, luggage must be entered"wink;
}

else
{
    addPassenger(nameInEntered, fare, weight, luggage);
     }
}
           }
   
    public void addPassenger(String nameIn,int fareIn, int weightIn, int luggageIn){
       name=nameIn;
       fare=fareIn;
       weight=weightIn;
       luggage=luggageIn;
       p= new Passenger(name,fare,weight,luggage); //passenger object
       tpw=weightIn+luggageIn; //calculates and adds the tpw
       if(tpw>=50&&tpw<=100&&tpw<WEIGHT&&seats>0){
           pass.add(p); //adds the passenger
           fare=fareIn+((tpw-50)*5); //calculates the fare
           totalfares=totalfares+fareIn;
           displayArea.setText("You have just added"+nameIn
            + "\n"
            + "Fare is"+fare);
           seats--;
           System.out.println(seats+"left"wink;
        }else if(tpw>=100&&tpw<=150&&tpw<WEIGHT&&seats>0){
       pass.add(p); //adds the passenger
       fare=fare+((tpw-100)*10);
       totalfares=totalfares+fareIn; //collects the total fares
      displayArea.setText("You have just added"+nameIn
            + "\n"
            + "Fare is"+fare);
       seats--;
       System.out.println(seats+"left"wink;//print out the name of the passanger u just added by getting its name u initialized
    }
    else {
         displayArea.setText("Passenger cannot be added!!"wink; // This is where I have got to
    }
}

    public ArrayList<Passenger> getPassengers(){
        System.out.println(pass);
        return pass;
    }
    public int getTotalfares(){
        System.out.println(totalfares);
        return totalfares;
    }
     public void removePassenger(String nameIn){
       Iterator<Passenger> i = pass.iterator();
       while(i.hasNext()){
           if(i.next().getName().equals(nameIn)){
               i.remove();
               totalfares=totalfares-fare;
               System.out.println(nameIn+ "has been removed"wink;
            }
        }
    }
    public void searchPassenger(String nameIn){
        Passenger pFound;
        Iterator<Passenger> i = pass.iterator();
        while(i.hasNext()){
            if(i.next().getName().equals(nameIn)){
               System.out.println(nameIn+ "is in the list"wink;
               pFound=i.next();
               break;
               
            }
        }
    }

}





public class Passenger {

private String name;
    private int fare;
    private int weight;
    private int luggage;
    private int tpw;
    private int totalTpw;
   
    public Passenger(String nameIn, int fareIn, int weightIn, int luggageIn){
        name=nameIn;
        fare=fareIn;
        weight=weightIn;
        luggage=luggageIn;
     }
    public int setWeight(int weightIn){
        weight=weightIn;
        return weight;
    }
    public String getName(){
        return name;
    }
    public int getFare(){
        return fare;
    }
    public int getWeight(){
        return weight;
    }
    public int getLuggage(){
        return luggage;
    }
    public int setTpw(){
        tpw=weight*luggage;
        return tpw;
    }
     public String toString(){
      return name + " " + fare + " " +weight+ " " +luggage;
    }

}




public class RunAircraftGUI{

public static void main(String[] args)
{
new AircraftGUI();
}
}

Re: Help On Java by Dolemite(f): 2:10pm On May 04, 2011
Oh wow man thank you!! soooooooooo much, you don't know how BIG this is for me THANKS!!
Re: Help On Java by csharpjava(m): 2:26pm On May 04, 2011
Dolemite

Oh wow man thank you!! soooooooooo much, you don't know how BIG this is for me THANKS!!
No worries!! you can always give me a shout if you need anymore assistance.
Re: Help On Java by Fayimora(m): 8:02pm On May 04, 2011
csharpjava:

Fayimora

Programming is one of the few professions where programmers are very selfish in helping those that are learning, with coding. I'm sure you cannot work in an agile environment, in which pair programming is a must (an XP development technique used by agile methodology) in this type of environment you are not allowed to hide your codes.

You start your programming career as a trainee and you are trained by advanced programmers, no amount of books you read can make you a very good programmer unless you see the way other programmers have written their codes.

This is not a forum for those doing their PHD, so stop asking those asking for help here to go and read books, they won't come here if they can find all the answers they want in books. 



Funny you. I ain't doing a Phd but would someday. If you really want to know then this is it. I am 17yrs old and just finished my first year. Am british by birth but a nigerian. Am not saying that you shouldn't post codes but hey, allow whoever is in question give it a try. The way i normally explain things are;
You ask a question, i give you a pseudo code. You try it until you get stuck. You come back with your code and i tell you where you have gone wrong and tell you what to do again.

It goes on in that loop until you et it. When you learn to think for yourself, then you have the tendencies to solve any problem no matter how large it is.

Now when he/she finish the code(Completely or to an acceptable level), then I give you my code which would just be another way of doing what you have already done.

Dolemite please dnt take ma next few sentences as an offence.

She said how can i put the first 2 classes into a gui!!!!!!!!! ?


That statement alone shows that she doesn't even understand what a GUI is. Now you have given code to her. What happens? It runs and does something. Ok cool. Now another assignment comes up and requires a GUI,  The rest is obvious. Because she still hasn't  understood what a gui is, she would post the same problem here. PLease help me with a gui.

She has an assignment thats due. OK cool help her but you obviously know that you ain't helping her. I can ask her to change something in that gui now (assuming I gave her the work) and when she get an error she won't be able to handle it. Why? because she doesn't understand the concept. Everything builds up around understanding the concept,

Anyways, this is the only forum out of about 12 which am currently in that does this. Seems to me like everyone just "wants it to work" without understanding what he/she is doing.

I however would't speak about this anymore,
Re: Help On Java by Fayimora(m): 8:09pm On May 04, 2011
Olamilec:

@Fayimora: please i read your post and i will like you to help me get some different used java books and even a self teach cd rom, i will send you the neccessary money you may require to buy and to send it, please i must know this java by fire by force cos am dying to know how to develop application. I will love to read your positive reply.

Ok cool. I could buy a very good one for you, you dnt have to pay me. I am currently writing exams therefore very busy.  Just [email=fayimora@hotmail.co.uk]mail[/email] me your address and when am free would get you one or two.

In the mean time, if you want e-books then i have over 700 of them and not just in Java alone. I could send some to you if you tell me how you want them. I mean either by email or upload and download.


Java is good and really improving speedily. I would advice you keep your passion for it and enjoy what it has t offer. Also, when learning Java don't get lot into its wonderful abilities/features but remember that you are lerning how to program and not how to write Java code.


Good Luck.
Re: Help On Java by dabrake(m): 8:27pm On May 04, 2011
import java.io.* ;
public class Class_name {
public static void main (String[] args) throws IOException{
String [] dig = new String [5] ;
BufferedReader in ;
in = new BufferedReader(new InputStreamReader(System.io)) ;
System.out.println("enter your digit(at most 5 digits) :"wink ;
String input = in.readLine() ;
if (input.length() != 5) return ;
for (i = 0 ; i <= 4 ; i++)
{dig[0] = input.substring(i , i+1)
System.out.print(dig[i] + " "wink ;}
}
}


do debug it 4 mi. Myt b prone 2 errors
Re: Help On Java by Fayimora(m): 8:55pm On May 04, 2011
Just a few errors, Can you state what exactly you wanna do?

The only errors you have are

in = new BufferedReader(new InputStreamReader(System.in)) //Notice the change?? "System.in" not io

dig[0] = input.substring(i , i+1); //you missed a semi-colon here

Those are basically the only errors.

So now what do you wanna do? Fill up an array with something and print it out?
Re: Help On Java by Dolemite(f): 9:34pm On May 04, 2011
Lol, Fayi you have no idea. . . grin
Re: Help On Java by Fayimora(m): 10:05pm On May 04, 2011
Dolemite:

Lol, Fayi you have no idea. . . grin


Bout?
Re: Help On Java by segsalerty(m): 10:21pm On May 04, 2011
This Thread is getting more and more interesting ! am Enjoying this, i fold my harms and watch now ! cheesy cheesy cheesy cheesy cheesy
Re: Help On Java by Fayimora(m): 10:36pm On May 04, 2011
Man go to bed, lolzz

(1) (2) (3) (4) (5) (Reply)

Programmers, How Do You Cope With Generator Noise In Your Area? / Female Programmers Stand Up And Be Counted / What Is Xvideoservicethief?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 96
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.