Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,361 members, 7,812,024 topics. Date: Monday, 29 April 2024 at 06:33 AM

Help On Java - Programming (5) - Nairaland

Nairaland Forum / Science/Technology / Programming / Help On Java (9568 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 Dolemite(f): 10:52pm On May 04, 2011
Fayimora:


Bout?
About what I'm about. . .even before he gave me the code I had built the gui on my own but still had to show appreciation because he took time off to do that for me. . .

segsalerty:

This Thread is getting more and more interesting ! am Enjoying this, i fold my harms and watch now ! cheesy cheesy cheesy cheesy cheesy
if(segsalerty.amused()==true)
{
seg.kill();
}
Re: Help On Java by segsalerty(m): 11:04pm On May 04, 2011
Fayimora:

Man go to bed, lolzz
i aint going anywhere, am gonna stay on here to watch u hommies grin till i tire
Dolemite:

if(segsalerty.amused()==true)
{
seg.kill();
}
uhmmm ,
while(Dolemite and others keeps posting){
i continue to dey watch!
if(Dolemite.sex == "female" && Dolemite.getKiss() == true){
Smilez all over my face and happy
break;
}
}
Re: Help On Java by Olamilec(m): 7:22am On May 05, 2011
@Fayimora Thanks for the reply, i am very greatful to your kind gesture. My address is Samade House, Dada Estate, Osogbo - Osun State. Name: Adeniji Olamilekan.
For the ebook, i will like you to send me anything about java, how i can use it to develop application. And the one that i can be using to practice like project base problem solving in the perspective of java. My email is olamilec@gmail.com i will be greatful if i can get the ebook email to my mail box asap. Thank you very much and God will also help you in time of your need.
Re: Help On Java by csharpjava(m): 11:02am On May 05, 2011
Fayimora
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.

You are from a computer science background, your approach is good in the lab as you have all the time in the world to keep going in a loop. In the real world of application development the approach is that of Software Engineering, which is “if a code already exist use it” if you ask me why? Well it is because if you have a deadline in which to complete a project, then you just need the code, but the algorithms you can work out after. This is the reason some people come here just for the code only. For algorithms and the pseudo code they can work that out after.
Re: Help On Java by Fayimora(m): 1:47pm On May 05, 2011
Your choice man!
Re: Help On Java by csharpjava(m): 11:43pm On May 06, 2011
Dolemite
Oh wow man thank you!! soooooooooo much, you don't know how BIG this is for me THANKS!!
This makes me feel better than all the pseudo codes and algorithms in this world grin grin
Re: Help On Java by Fayimora(m): 8:08pm On May 07, 2011
Olamilec:

@Fayimora Thanks for the reply, i am very greatful to your kind gesture. My address is [removed]
For the ebook, i will like you to send me anything about java, how i can use it to develop application. And the one that i can be using to practice like project base problem solving in the perspective of java. My email is olamilec@gmail.com i will be greatful if i can get the ebook email to my mail box asap. Thank you very much and God will also help you in time of your need.

Sorry for the late reply,  Ddnt realise you have replied my previous post. please send me an [email=mailto:fayimora@hotmail.co.uk]email[/email] and i would reply with significant materials to get you started. Also please state the spec of the system you would mostly be using so i can add additional materials if needed.

Also I would advise you take off your details(home address) from your post

Fayimora
Re: Help On Java by Dolemite(f): 3:51pm On May 08, 2011
Can someone please explain to me in dummyproof terms what casting (upcasting, downcasting) means especially in objects, ive gone through tons of turorials and still can't seem to get it. . .in simple terms please.
Re: Help On Java by Fayimora(m): 6:58pm On May 08, 2011
Basically what you need to really understand is casting. Whether down or up, its still casting. So am going to explain casting.

First, you must understand, that by casting you are not actually changing the object itself, you are just labeling it differently. The main purpose of casting is Polymorphism. The ability to re-use objects with different instances.

Take a look at this picture;


Now say you have this;

    Cat theCat = new Cat();
    System.out.println(theCat);
    Mammal m = theCat; // upcasting
    System.out.println(m);


Now The object i could have created is

Mammal m = new Mammal();


But i want to be able to use an instance of cat, so what I do is cast the object reference of Mammal which is m to hold an instance of Cat class.

Thats is what I have done above. If you are familiar with polymorphism, then its the same thing.


    Cat theCat = new Cat();
    System.out.println(theCat);
    Mammal m = theCat; // upcasting
    System.out.println(m);

This can also be written as

    Mammal m = new Cat();
    System.out.println(m);


Upcasting is normally done automatically but downcasting must be done manually.

An example of downcasting is;

    Cat c1 = new Cat();
    Animal a = c1; //upcasting to Animal
    if(a instanceof Cat){ // testing if the Animal is a Cat
        System.out.println("It's a Cat! Now i can safely downcast it to a Cat, without a fear of failure."wink;       
        Cat c2 = (Cat)a;



Now you have to note that thee is a criterion for casting. This s because a ClassCastException would be thrown if  the class you are trying to cast is not an instanceof(more or less a subclass) the other class. Sorry if you don't understand. But you would understand better if you put it into practice.

You should ask, is Cat a Mammal? Yes, it is - that means, it can be casted.
Is Mammal a Cat? No it isn't - it cannot be casted. So yeah thats where inheritance comes into play. They must have tht is-a/an relationship.

Be happy to answer any further questions.
Good Luck
Re: Help On Java by csharpjava(m): 7:38pm On May 08, 2011
Try this youtube video it should make it simple for you to understand


https://www.youtube.com/watch?v=3ILIFUoFxmE
Re: Help On Java by segsalerty(m): 9:53pm On May 08, 2011
Fayimora:

Basically what you need to really understand is casting. Whether down or up, its still casting. So am going to explain casting.

First, you must understand, that by casting you are not actually changing the object itself, you are just labeling it differently. The main purpose of casting is Polymorphism. The ability to re-use objects with different instances.

Take a look at this picture;


Now say you have this;

    Cat theCat = new Cat();
    System.out.println(theCat);
    Mammal m = theCat; // upcasting
    System.out.println(m);


Now The object i could have created is

Mammal m = new Mammal();


But i want to be able to use an instance of cat, so what I do is cast the object reference of Mammal which is m to hold an instance of Cat class.

Thats is what I have done above. If you are familiar with polymorphism, then its the same thing.


    Cat theCat = new Cat();
    System.out.println(theCat);
    Mammal m = theCat; // upcasting
    System.out.println(m);

This can also be written as

    Mammal m = new Cat();
    System.out.println(m);


Upcasting is normally done automatically but downcasting must be done manually.

An example of downcasting is;

    Cat c1 = new Cat();
    Animal a = c1; //upcasting to Animal
    if(a instanceof Cat){ // testing if the Animal is a Cat
        System.out.println("It's a Cat! Now i can safely downcast it to a Cat, without a fear of failure."wink;       
        Cat c2 = (Cat)a;



Now you have to note that thee is a criterion for casting. This s because a ClassCastException would be thrown if  the class you are trying to cast is not an instanceof(more or less a subclass) the other class. Sorry if you don't understand. But you would understand better if you put it into practice.

You should ask, is Cat a Mammal? Yes, it is - that means, it can be casted.
Is Mammal a Cat? No it isn't - it cannot be casted. So yeah thats where inheritance comes into play. They must have tht is-a/an relationship.

Be happy to answer any further questions.
Good Luck


nice one, Good! smiley
csharpjava:

Try this youtube video it should make it simple for you to understand


https://www.youtube.com/watch?v=3ILIFUoFxmE
cool !

Dolemite:

Can someone please explain to me in dummyproof terms what casting (upcasting, downcasting) means especially in objects, ive gone through tons of turorials and still can't seem to get it. . .in simple terms please.

Hope u now understand wat these terms mean now? wink
U surely need to understand all concepts of Programming , OOP in particular before GUI , lolz
Re: Help On Java by abenmariem: 12:23pm On Aug 02, 2016
There is a difference between casting and conversion.
In your case you need conversion.
I recommend also this website to learn java casting.

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

Programmers, How Do You Cope With Generator Noise In Your Area? / Female Programmers Stand Up And Be Counted / Are You A Real Programmer? Can You Code With Notepad?

(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. 32
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.