Search:

Type: Posts; User: adit

Search: Search took 0.07 seconds.

  1. Re: how to take array input from main method and use it in one of the classes

    i am using eclipse as IDE

    i hope its correct now...



    class Book{
    String title;
    String author;
    int count;
  2. Re: how to take array input from main method and use it in one of the classes

    is it correct now





    package module4c;

    class Book{
    String title;
  3. Re: how to take array input from main method and use it in one of the classes

    Doubt
    i tried using attribute 'length' but in (books.length) 'books' corresponds to Book[].module 4c but it should correspond to my input Book[] books.
    i am giving the code plz help.


    package...
  4. Re: how to take array input from main method and use it in one of the classes

    thanks...
    i was trying to find out the total no of different books (ie 4 is the answer).so , i thought that if i could find the length of the Book [] books, i would get my answer. Is my approach...
  5. how to take array input from main method and use it in one of the classes

    QUESTION
    I have to find total number of different books in method getdiffCount().


    package module4c;

    class Book{
    String title;
    String author;
    int count;
  6. how to take array input from main method and use it in one of the classes

    QUESTION
    I have to find total number of different books in method getdiffCount().


    package module4c;

    class Book{
    String title;
    String author;
    int count;
  7. [SOLVED] Re: how to convert a input array of type Strings to a class type

    i have tried this question in a different way....is it correct??...but there are some mistakes due to which i am not getting the output.....it would be great if you could point out to me...


    ...
  8. [SOLVED] Re: how to convert a input array of type Strings to a class type

    when i write static in the code it gives following error.....and i am having difficulty in correcting that...

    error

    The method main cannot be declared static; static methods can only be...
  9. [SOLVED] Re: how to convert a input array of type Strings to a class type

    I have coded the Passenger construct but i dont understand how to add the total weight of all the passengers ...if you could give some hint...



    package module4a;

    class Passenger{
    String...
  10. [SOLVED] Re: how to convert a input array of type Strings to a class type

    made some progress...but still a lot to do...

    giving my code here...


    package module4a;

    class Passenger{
    String name;
    int age;
  11. [SOLVED] Re: how to convert a input array of type Strings to a class type

    MY INITIAL QUESTION

    Define a class Passenger having the fields name (String), age (int), gender (char : M/F), weight (int). Define 2 constructors for this class, one with parameters and one which...
  12. [SOLVED] Re: how to convert a input array of type Strings to a class type

    QUESTION
    Define a class Passenger having the fields name (String), age (int), gender (char : M/F), weight (int). Define 2 constructors for this class, one with parameters and one which has no...
  13. [SOLVED] Re: how to convert a input array of type Strings to a class type

    thanks for replying..
    @Kevin

    while giving input it is either a type of String or int or char.And it gives a error (cannot convert from String to passenger). So i think i need to give the input...
  14. [SOLVED] how to convert a input array of type Strings to a class type

    class Passenger{
    String name;
    int age;
    char gender;
    int weight;

    public Passenger(){
    }
    public Passenger(String name,int age,char gender,int weight){
    }
Results 1 to 14 of 14