i am using eclipse as IDE
i hope its correct now...
class Book{
String title;
String author;
int count;
Type: Posts; User: adit
i am using eclipse as IDE
i hope its correct now...
class Book{
String title;
String author;
int count;
is it correct now
package module4c;
class Book{
String title;
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...
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...
QUESTION
I have to find total number of different books in method getdiffCount().
package module4c;
class Book{
String title;
String author;
int count;
QUESTION
I have to find total number of different books in method getdiffCount().
package module4c;
class Book{
String title;
String author;
int count;
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...
...
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...
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...
made some progress...but still a lot to do...
giving my code here...
package module4a;
class Passenger{
String name;
int age;
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...
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...
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...
class Passenger{
String name;
int age;
char gender;
int weight;
public Passenger(){
}
public Passenger(String name,int age,char gender,int weight){
}