This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!

Manaf Abdul

Greenhorn
+ Follow
since May 23, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
-1
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Manaf Abdul

Generally the example given for classes and objects is like : If I have a class car then it can have various objects like bmw, mercedes etc. and other similar examples. But isnt this an example of inheritance? So whats the difference ?
2 years ago
Can someone explain me (a 10th grade student) ...What exactly is an enum ? I am just interested to know about it. Please explain with an example.
2 years ago

My Project is called Airlines_Booking

Can someone please check this naming convention of mine and if its not appropriate can you please suggest appropraite names wherever possible?

1 ) First there's an interface that defines all the methods I will use in my upcoming classes ----> I call it Basic

2) There's is an abstract class that implements the interface and has the common methods of my Airline classes (methods like takename() , takenoofpeople() etc.)----> I call it CommonAirline_Methods

3) There's a class that has the method cost if user wants to travel in Economy class (you must be aware of the class that are available in Airlines like Economy, Business, and Premium Economy) and this class extends the abstract class -----------------> I call it Economy

4) There's a class that has the method cost if user wants to travel in Business class and obviously this also extends the abstract class because the common methods of all the classes are there in the abstract class -------> I call it Business

5)There's a class that has the method cost if user wants to travel in Premium Economy and same thing as the other two classes -----> I call it PremiumEconomy

6) There's a common class in which I ask the user that "do you want to travel in Economy, Premium Economy or Business class " and if he chooses 'E' then I create an object of class E and execute it's methods easily and similarly if he chooses B or P..............THis is the most important class of the project since the user( or a lay man) has to execute only this class for booking the tickets..............--> I call it Book_Tickets

I have just named everything and the project is working perfectly. This is the last step ..can someone please help me to name the classes .Pleasee ..Thanks a lot.
2 years ago
Is there any term used for void methods (methods that dont return any value)?
2 years ago

Les Morgan wrote:How about "Junk"? I name all my classes that I work with for help on the forums as Junk. For your assignment though you might want "TravelClass" or "TravelType".

................. Are you being sarcastic bro?
2 years ago
My Project is called Airlines_Booking


1 ) First there's an interface that defines all the methods I will use in my upcoming classes ----> I call it Basic

2) There's is an abstract class that implements the interface and has the common methods of my Airline classes (methods like takename() , takenoofpeople() etc.)----> I call it CommonAirline_Methods

3) There's a class that has the method cost if user wants to travel in Economy class (you must be aware of the class that are available in Airlines like Economy, Business, and Premium Economy) and this class extends the abstract class -----------------> I call it Economy

4) There's a class that has the method cost if user wants to travel in Business class and obviously this also extends the abstract class because the common methods of all the classes are there in the abstract class -------> I call it Business

5)There's a class that has the method cost if user wants to travel in Premium Economy and same thing as the other two classes -----> I call it PremiumEconomy

6) There's a common class in which I ask the user that "do you want to travel in Economy, Premium Economy or Business class " and if he chooses 'E' then I create an object of class E and execute it's methods easily and similarly if he chooses B or P..............THis is the most important class of the project since the user( or a lay man) has to execute only this class for booking the tickets..............--> I call it Book_Tickets

I have just randomly named everything and the project is working perfectly. This is the last step ..can someone please help me to name the classes .Pleasee ..Thanks a lot.
2 years ago
Is it possible to perform Binary Search on a String Matrix ? If yes, then how ? Please explain with example.
2 years ago
Since abstract class cannot be instantiated therefore you cannot access their variables by creating an object so how do you access the variables of abstract class. Please explain with a simple example .
2 years ago
Hey everyone This is the project software I am supposed to make
Software on “Airline Booking“
You need to make a project on “ Airline Booking” in Blue J, where you have to collect all the conditions
and functions of airline booking . You can take help from the internet to know the functions of Airline
Booking.
Terms and ConditionsYou
need to name 3 classes, as first, second and third, where the user will choose the class and he will
pay the amount .You will find amount details as per the cities from the internet.
Display the remaining seats to the fresh user after the bookings and ask for more bookings from the user.
After booking, use “Switch Case”, if the user says “Yes” switch the program from the beginning else, quit
and display the bill.
Include the following topics in your software–
1. Classes and Objects
2. Function and Function Overloading
3. Constructor and Constructor Overloading
4. Inheritance
5. Interfaces,
6. Array (1 and 2D array),
7. Switch Case.
8. Loops.
9. Types of IF Statement.
// Project should be well commented, documented and arranged in a proper format.
Last Date of Submission – 6/June/2016

I am done with everything above thats not coloured but left with the red coloured part. Can someone please help me out with ideas or dodes as to how am I supposed to implement those two things in my project since I am actually struggling over it since dayss!!! Please help really in need of it.

Thankx a lot , Btw this is just an awesome community and the people here are really helpful and cooperative unlike the StackExchange community with all sorts of arrogant people.
2 years ago

Dóra Takács wrote:

Can someone tell me the difference between throw and throws keyword alongwith appropriate examples.




2.)----------------------------------------------------------------------------------------------
The throw keyword:

Here, the throw says that something actually went wrong. You know for sure, that something happened that should not have happened, and you anticipated the possibility. In this case, without exception handling, the execution of the method would end here, and unless the programmer invoking your method handled the possible exception, the program will end with a stack trace of the exception, so you would see what happened, what went wrong.



Summary) -------------------------------------------------------------------------------------
The point is, with throws, you declare that something might go wrong in your method.
With throw, you define what kind of problem occoured, and you know for sure that something did indeed, go wrong during execution.
Also, as you see in the example, the throw keyword requires you to have an exception object, which you might aswell create on the same line.


Best regards, Dóri



Great explanation indeed but I still dont understand that why do you need to unnecessarily throw an exception using "throw"
2 years ago

Tim Cooke wrote:Only you know what your Book class does, so only you can describe it. What you have there is JavaDoc and serves as documentation of your software so the Java compiler doesn't care what you write in there, it only serves as documentation for others to understand the purpose of that class in the context of your application. Write a description that conveys that information.



can you give another simple example like without using class book
2 years ago

Dave Tolls wrote:All that needs is a description of what the Book class represents and what it does.




so can you give an example if it's so simple ??
2 years ago

Dóra Takács wrote:Since we have no idea how complicated this application of yours might be, . . . Your teacher probably just want you to get familiar with handling and using one.



You are right my teacher can't tell me but I am still struggling since I cant use the method you suggested because cost for travelling from different cities and to different cities is different . Can you please give me a better idea. I will be grateful brother.
2 years ago

khadar valli wrote:

Constructor is a method with which you can initialize some parameters at the time of creating an object. When the object is created, Java calls the constructor first(default constructor). Any code you have in your constructor will then get executed. You don't need to make any special calls to a constructor method - they happen automatically when you create a new object.

May be it will helpful to you to understand the constructors.

Regards,
Khadar.



i want 2 exact points on uses of constructors
2 years ago
Can someone tell me the difference between throw and throws keyword alongwith appropriate examples.
2 years ago