[Show all top banners]

zeePa
Replies to this thread:

More by zeePa
What people are reading
Subscribers
Subscribers
[Total Subscribers 1]

paroo
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 TechGuy Help needed
[VIEWED 5681 TIMES]
SAVE! for ease of future access.
Posted on 05-09-09 11:44 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Hey TechGuys out there i am trying learn java data structures, LinkedList class and i am simply not getting anything. Can anyone shed some light on how to solve this problem with explanation commented as each code goes thru..


There has to be a class named Student that includes String data fields for firstName and lastName.  There has to be a constructor that requires two String parameters to populate the firstName and lastName fields. There has to be a List of 20 Student objects each having different first and last names.  Finally Print  LinkedList, first in the order your items were placed onto the LinkedList and then in reverse order.  Required  files to be saved as Student.java and ClassRoster.java.


Dorje


 
Posted on 05-10-09 1:14 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

haina ho sajha ma gan than bhanda pani homework sodne dherai huna thale, kta haru padne bela ma ghanta hanna besta chaan ani homework bujhaune bela ayepachi aru lie sodhna thalchaan, baru nepal nai gaye bhai halyo ni yo bhanda ta...khitiii khitiii khitiii khitiii haas uthchaa bhanya

 
Posted on 05-10-09 4:44 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

public class Student {
    
    String firstName;
    String lastName;
    Student(String fName, String lName)
    {
        firstName = fName;
        lastName = lName;
    }
    
    void display()
    {
        System.out.println(firstName);
        System.out.println(lastName);
    }

}





import java.util.LinkedList;


public class ClassRoster {
    
    static void orderPrint(LinkedList l)
    {
        int size = l.size();
        for(int i=0; i < size; i++)
        {
            Student s =(Student) l.get(i);
            s.display();
        }
            
    }
    
    static void reverseOrderPrint(LinkedList l)
    {
        int size = l.size();
        for(int i=size-1;i>=0;i--)
        {
            Student s =(Student) l.get(i);
            s.display();
        }
    }

    public static void main(String args[])
    {
        //Get 20 students information using loop
        //I've used only two objects for the example
        Student s1 = new Student("AA","BB");
        Student s2 = new Student("CC","DD");
        LinkedList l = new LinkedList();
        l.add(s1);
        l.add(s2);
       // End of inputs
        orderPrint(l);
        reverseOrderPrint(l);
    }
}


Let me know if u didnt understand any part
 
Posted on 05-10-09 6:49 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Rajmani bro,


                    Hasayo rajmani bro le pani. Timi sarai narrow-minded person raichau bro..look at techguy..if someone is asking for help, i would rather help than leave such funny comments. Let me know if i can help you in any aspects of your life...And Million thanks to Techguy. He who listens to others plead will never have to plead coz god will listen to him all the time...Thank you, gentleman!


Dorje.


 
Posted on 05-10-09 8:42 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Ok Rajmani, here you go: Why don't you just kiss my ass? How about that?!


Dorje


 
Posted on 05-10-09 10:02 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Zeepa (Dorje) bro le balla yo rajmani bhanne sano bichar bhako manche lai chup lagayo. Rajmani bro timi ta professor le bujhako ta sabai bujda rahechau tyehi bhayera timile SLC ma board first haneko hola, ani US pani scholarship ma ako hola ani timi ta yaha ghanta na hani basirako chau haina???? saathi nabujheko kura sabaile sodhna pauchan it doesn't matter whether it is in sajha or any other website. ra ramro bichar bhako TECHGUY jasto manche lai chai HATSOFF.



 
Posted on 05-10-09 11:07 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Dharanstar,


          Hats off to ya to for positively taking it. Thanks bro. Rajmani and people with attitude like his should go to mexico and mow some mexican yards in summer.


Dorje


 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 90 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
Toilet paper or water?
ढ्याउ गर्दा दसैँको खसी गनाउच
Sajha Poll: Who is your favorite Nepali actress?
Problems of Nepalese students in US
Mamta kafle bhatt is still missing
Tourist Visa - Seeking Suggestions and Guidance
To Sajha admin
From Trump “I will revoke TPS, and deport them back to their country.”
Are Nepalese cheapstakes?
अरुणिमाले दोस्रो पोई भेट्टाइछिन्
wanna be ruled by stupid or an Idiot ?
MAGA denaturalization proposal!!
Nepali Psycho
advanced parole
How to Retrieve a Copy of Domestic Violence Complaint???
seriously, when applying for tech jobs in TPS, what you guys say when they ask if you have green card?
and it begins - on Day 1 Trump will begin operations to deport millions of undocumented immigrants
Travel Document for TPS (approved)
All the Qatar ailines from Nepal canceled to USA
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters