Please Post All Your Java Programing Questions Here.

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 22, 2009, 03:20 AM
430661 members and 297813 Topics
Latest Member: pstkriz
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Please Post All Your Java Programing Questions Here.
Pages: (1) (2) Go Down Send this topic Notify of replies
Author Topic: Please Post All Your Java Programing Questions Here.  (Read 1243 views)
blacksta (m)
Please Post All Your Java Programing Questions Here.
« on: April 18, 2009, 02:10 PM »

To all java experts  - can somebody please define abstractation and encapulation in java with examples - Thanks
ice_man
Re: Please Post All Your Java Programing Questions Here.
« #1 on: April 21, 2009, 01:21 PM »

If you really want to learn stuff about java, i suggest u lay your hands on books like: thinking in java, or java how to program,  They're available in pdf
SayoMarvel (m)
Re: Please Post All Your Java Programing Questions Here.
« #2 on: April 21, 2009, 04:57 PM »

Please can you send me the pdf version of java how to program? Prefarably the 7th edition but if that is not available, you can send me any other edition of the book. u can upload it or send it to my e-mail. marvelindaclub@yahoo.com
linxon (m)
Re: Please Post All Your Java Programing Questions Here.
« #3 on: April 24, 2009, 02:55 PM »

Quote from: blacksta on April 18, 2009, 02:10 PM
To all java experts  - can somebody please define abstractation and encapulation in java with examples - Thanks

Abstraction and Encapsulation are quite similar and confusing when you start oops programming, but heres my explanation:

Abstraction means hiding the internal details and just exposing the ‘relevant’ functionality (i.e. the interface). For Example:-When you change the gear of your car, you know the gears will be changed without knowing how they are functioning internally. Now I have not coded in Java for about a year  but from the top of my head:

public interface GearBox
{
   int gearOne();
   int gearTwo();
   int gearThree();
   int gearFour();
   int gearFive();
int reverse();
int neutral();
}

Encapsulation refers to the transparency of an object - information hiding. By hiding the information inside an object we prevent a client from making unauthorized modifications, why? it makes code more robust. For example:

public class NaijaCar extends Car implements GearBox
{
   public NaijaCar() {  //init code here }
   
   private double acceleration = 1.0;
      
   //Now implement the interface
   
public int gearOne()
{
   super.speed += acceleration;
}

public int gearTwo() {
   super.speed += acceleration * 2.0;
}
//And so on for gear 2,3 and 4
public int gearFive()
{
   super.speed += acceleration * 5.0;
}
public int reverse()
{
   super.speed -= acceleration;
}
public int neutral()
{
   super.speed = 0.0;
}
}

So you can see the Abstraction in the sense that users of NaijaCar use all mthe relevant gearbox methods without knowing the deatils of how each one works. some homework for you, where is the encapsulation in NaijaCar?
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #4 on: April 24, 2009, 04:50 PM »

As an object oriented programmer their are 4 principles or pillar you will need to understand and the rest is history

Pillar #1: Encapsulation
Pillar #2: Inheritance
Pillar #3: Polymorphism
Pillar #4: Abstraction - some argue you only have the 3 top pillars


would anybody please give defination for the above  - thanks

also thanks to Linxon ( wonderful example)
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #5 on: May 06, 2009, 05:24 AM »

 Shocked
candylips (m)
Re: Please Post All Your Java Programing Questions Here.
« #6 on: May 06, 2009, 12:56 PM »

u bumped the thread right.   Smiley

in your last post you listed 4 core oo principles. Just  to add also that it is good oo practice to favor Encapsulation vs Inheritance cos it allows for very flexible oo designs
Kobojunkie
Re: Please Post All Your Java Programing Questions Here.
« #7 on: May 07, 2009, 04:49 PM »

Abstraction is definitely an OOP basic.
akinwunmi (m)
Re: Please Post All Your Java Programing Questions Here.
« #8 on: May 20, 2009, 11:34 PM »

Helloooo

am about using Netbeans for Java programming. I would like to know if its like Visual Basic.net.

thanks
bigboyslim (m)
Re: Please Post All Your Java Programing Questions Here.
« #9 on: May 21, 2009, 12:43 AM »

Abstraction - from the word abstract - meaning overview - As an analogy, when you read a technical document. There's always an abstract which gives a general overview of what the document is about.

In Object Oriented programming, Abstraction gives the specification of an Interface. i.e it gives the Name of the interface and the names of all the methods in the interface but not the details. Any class that plans to implement that interface must use the specified methods. You make use of the specified methods but you supply the details in each method yourself.

Encapsulation on the other hand refers to the fact that the when a user uses an object of a class, he has no ability to change the inner operations of the class methods and variables. That is the internal operations of the class is shielded protected or encapsulated.
bigboyslim (m)
Re: Please Post All Your Java Programing Questions Here.
« #10 on: May 21, 2009, 12:55 AM »

Inheritance is the relationship between two classes that allows an object of one class called the sub class to use the methods already defined in another class called the super class. The syntax is

Class Subclass extends Superclass
For example

Class Vehicle{

     accelerate();
     reverse ();
     changeGear();

}

Class SUV extends Vehicle{

// no need to specify the accelerate(). reverse(); and changeGear() methods.   (except during method overriding)

}

Class Vehicle is the superclass while class SUV is the subclass. Class SUV inherits the methods of class Vehicle, therefore if you create an object of Class SUV and make it inherit from class Vehicle, you can call the methods of the superclass Vehicle without having to define them in the SUV object.
The primary purpose of inheritance is code reuse. i.e you don't have to keep defining methods for each object you create.









candylips (m)
Re: Please Post All Your Java Programing Questions Here.
« #11 on: May 21, 2009, 10:37 AM »

Quote from: akinwunmi on May 20, 2009, 11:34 PM
Helloooo

am about using Netbeans for Java programming. I would like to know if its like Visual Basic.net.

thanks

No where near as good as Visual Studio am afraid.
hymnha (m)
Re: Please Post All Your Java Programing Questions Here.
« #12 on: May 25, 2009, 03:50 AM »

Hello. pls kindly assist me with this prob.
I am introducing  a password page to an application. But i'm stock in between pls cam somebody help me on how to go about it
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #13 on: July 13, 2009, 11:31 PM »

 ;d
Quote from: linxon on April 24, 2009, 02:55 PM
Abstraction and Encapsulation are quite similar and confusing when you start oops programming, but heres my explanation:

Abstraction means hiding the internal details and just exposing the ‘relevant’ functionality (i.e. the interface). For Example:-When you change the gear of your car, you know the gears will be changed without knowing how they are functioning internally. Now I have not coded in Java for about a year  but from the top of my head:

public interface GearBox
{
   int gearOne();
   int gearTwo();
   int gearThree();
   int gearFour();
   int gearFive();
int reverse();
int neutral();
}

Encapsulation refers to the transparency of an object - information hiding. By hiding the information inside an object we prevent a client from making unauthorized modifications, why? it makes code more robust. For example:

public class NaijaCar extends Car implements GearBox
{
   public NaijaCar() {  //init code here }
   
   private double acceleration = 1.0;
      
   //Now implement the interface
   
public int gearOne()
{
   super.speed += acceleration;
}

public int gearTwo() {
   super.speed += acceleration * 2.0;
}
//And so on for gear 2,3 and 4
public int gearFive()
{
   super.speed += acceleration * 5.0;
}
public int reverse()
{
   super.speed -= acceleration;
}
public int neutral()
{
   super.speed = 0.0;
}
}

So you can see the Abstraction in the sense that users of NaijaCar use all mthe relevant gearbox methods without knowing the deatils of how each one works. some homework for you, where is the encapsulation in NaijaCar?


public class NaijaCar extends Car implements GearBox
{
   public NaijaCar() {  //init code here }
   
   private double acceleration = 1.0;
      
   //Now implement the interface
   
public int gearOne()


The field decleared private cant not be accessed by anyone outside of the class
puskin
Re: Please Post All Your Java Programing Questions Here.
« #14 on: July 14, 2009, 03:26 AM »

@blacksta
Seeing U r a java programmer.
I nid your help.
I am making a career change in2 programming, so I nid all d help I can get.
I am hoping U nd others alike will b of assistance 2me.
Pls, i wud b grateful if U cud assist me with some Java ebooks 4beginners nd also d compiler or U cud just paste d sites/links whr I can dwnld them 4rm.
Thanks.
Evagreenfields (f)
Re: Please Post All Your Java Programing Questions Here.
« #15 on: July 14, 2009, 08:34 AM »

Helo people.plx can i get d rough estimate of being a sun java certified programmer/developer and how long it takes to run the programme,all tins being equal.tanx
zap2 (m)
Re: Please Post All Your Java Programing Questions Here.
« #16 on: July 17, 2009, 08:03 AM »

@ iceman, pls how can i get pdf on  how to progran java,  pls send it to my netfreakz@gmail.com. tnx
Evagreenfields (f)
Re: Please Post All Your Java Programing Questions Here.
« #17 on: July 17, 2009, 09:02 AM »

Pls anyone with useful info to my questn shld pls email me-evagreenfields@gmail.com
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #18 on: July 18, 2009, 12:04 AM »

Quote from: Evagreenfields on July 14, 2009, 08:34 AM
Helo people.plx can i get d rough estimate of being a sun java certified programmer/developer and how long it takes to run the programme,all tins being equal.tanx

Are u talking about a self study route or Attending a college >
Evagreenfields (f)
Re: Please Post All Your Java Programing Questions Here.
« #19 on: July 18, 2009, 08:36 AM »

Self study,@blacksta,i just want to read up java programming books and then sit 4 the programming exam,
uche1 (m)
Re: Please Post All Your Java Programing Questions Here.
« #20 on: July 27, 2009, 12:26 PM »

Hello All
@Blacksta,  plz can u help me out with this assignment.

How java handles graphic and example of simple program to effect it.

post it here or u can send it to my mail  bloomstech@yahoo.com

waiting for your reply.

Thanks 
freeze1982
Re: Please Post All Your Java Programing Questions Here.
« #21 on: July 27, 2009, 03:02 PM »

 :'(hello moderator and all nairaland fan,i'm a graduate of mathematics/computer sci. After my graduation i decide 2 learn JAVA programming to boost my knowledge.but the language is difficult.i hav decide 2 pick it up,4rm 2moro.i need help my email is bluediva555@yahoo.com,pls if u hav any codes 2 assist me i'll be glad. Grin Cool
kencas
Re: Please Post All Your Java Programing Questions Here.
« #22 on: July 28, 2009, 03:19 PM »

Data abstraction means hiding some data elements of a class from the public

class Student
{
  private String regNo;
  private String name;

public void setRegno(String regNo)
{
this.regNo= regNo;
}

public String getRegno()
{
return regNo;
}

public void setName(String name)
{
this.name= name;
}

public String getName()
{
return name;
}

}

Hoope this explains the concept
Everything
Re: Please Post All Your Java Programing Questions Here.
« #23 on: July 28, 2009, 06:44 PM »

Quote from: uche1 on July 27, 2009, 12:26 PM
How java handles graphic and example of simple program to effect it.

Familiarize yourself with the Java 2D API. It's a whole lot of package. You'll see lots of (hands-on) examples while learning!!!

Visit http://www.corewebprogramming.com/PDF/ch10.pdf for Java 2D tutorial.
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #24 on: July 29, 2009, 10:20 PM »

JAVA BOOKS FOR DOWNLOAD

Java Examples in a Nutshell, 3rd Edition
By David Flanagan


* Publisher: O'Reilly Media, Inc.
* Number Of Pages: 720
* Publication Date: 2004-01-01
* ISBN-10 / ASIN: 0596006209
* ISBN-13 / EAN: 9780596006204
* Binding: Paperback



Product Description:

The author of the best-selling Java in a Nutshell has created an entire book of real-world Java programming examples that you can learn from. If you learn best "by example," this is the book for you.

This third edition covers Java 1.4 and contains 193 complete, practical examples: over 21,900 lines of densely commented, professionally written Java code, covering 20 distinct client-side and server-side APIs. It includes new chapters on the Java Sound API and the New I/O API. The chapters on XML and servlets have been rewritten to cover the latest versions of the specifications and to demonstrate best practices for Java 1.4. New and updated examples throughout the book demonstrate many other new Java features and APIs.

Java Examples in a Nutshell is a companion volume to Java in a Nutshell, Java Foundation Classes in a Nutshell, and Java Enterprise in a Nutshell. It picks up where those quick references leave off, providing a wealth of examples for both novices and experts. This book doesn’t hold your hand; it simply delivers well-commented working examples with succinct explanations to help you learn and explore Java and its APIs.

http://w14.easy-share.com/1702920065.html


* 51ZNuU6G2lL.jpg (39.98 KB, 329x500 )
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #25 on: July 29, 2009, 10:22 PM »

Thinking in Java
By Bruce Eckel


* Publisher: Prentice Hall PTR
* Number Of Pages: 1098
* Publication Date: 1998-02-19
* ISBN-10 / ASIN: 0136597238
* ISBN-13 / EAN: 9780136597230
* Binding: Paperback



Product Description:

The legendary author Bruce Eckel brings Java to life with this extraordinarily insightful, opinionated and downright funny introduction. Thinking in Java introduces all of the language's fundamentals, one step at a time, using to-the-point code examples. More than virtually any other book, Thinking in Java helps you understand not just what to do -- but why. Eckel introduces all the basics of objects as Java uses them; then walks carefully through the fundamental concepts underlying all Java programming -- including program flow, initialization and cleanup, hiding implementations, reusing classes and polymorphism. Using extensive, to-the-point examples, he introduces error handling, exceptions, Java I/O, run-time type identification, and passing and returning objects. He covers the Java AWT, multithreading, network programming with Java -- even design patterns. The best way to understand the real value of this book is to hear what readers of the online version have been saying about it: "much better than any other Java book I've seen, by an order of magnitude, " "mature, consistent, intellectually honest, well-written and precise, " "a thoughtful, penetrating analytical tutorial which doesn't kowtow to the manufacturers, " "Thank you again for your awesome book. I was really floundering, but your book has brought me up to speed as quickly as I could read it!"For both beginner and experienced C and C++ programmers who want to learn Java.

* From the basics of object development, all the way to design patterns and other advanced topics.

* By the author of the best-selling Thinking in C++ -- winner of the 1995 Jolt Cola Award!

* On-line version has already received tens of thousands of hits -- there's a huge built-in demand for this book!

Download Links:
Code:

http://www.megaupload.com/?d=177J8HKO



* 61VRKHPVQ6L.jpg (69.03 KB, 354x475 )
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #27 on: July 29, 2009, 10:24 PM »

Head First Java, 2nd Edition
By Kathy Sierra, Bert Bates


* Publisher: O'Reilly Media, Inc.
* Number Of Pages: 720
* Publication Date: 2005-02-09
* ISBN-10 / ASIN: 0596009208
* ISBN-13 / EAN: 9780596009205
* Binding: Paperback



Product Description:

Learning a complex new language is no easy task especially when it s an object-oriented computer programming language like Java. You might think the problem is your brain. It seems to have a mind of its own, a mind that doesn't always want to take in the dry, technical stuff you're forced to study.

The fact is your brain craves novelty. It's constantly searching, scanning, waiting for something unusual to happen. After all, that's the way it was built to help you stay alive. It takes all the routine, ordinary, dull stuff and filters it to the background so it won't interfere with your brain's real work--recording things that matter. How does your brain know what matters? It's like the creators of the Head First approach say, suppose you're out for a hike and a tiger jumps in front of you, what happens in your brain? Neurons fire. Emotions crank up. Chemicals surge.

Download Links:
Code:

http://www.megaupload.com/?d=RBKQ55WY



* 51iqJtlE0uL.jpg (53.8 KB, 432x500 )
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #28 on: July 29, 2009, 10:27 PM »

If u need more books  or certification exam notes let me know
ikmomen (m)
Re: Please Post All Your Java Programing Questions Here.
« #29 on: August 20, 2009, 01:25 PM »

@blacksta, pls can i get a book for newbie programmers
blacksta (m)
Re: Please Post All Your Java Programing Questions Here.
« #30 on: August 20, 2009, 01:37 PM »

Quote from: ikmomen on August 20, 2009, 01:25 PM
@blacksta, pls can i get a book for newbie programmers

Try the head first Java series very good for newbies
candylips (m)
Re: Please Post All Your Java Programing Questions Here.
« #31 on: August 20, 2009, 01:45 PM »

head first  Huh what of mouth first  Undecided
 Mysql Lower Case Table Names  Which Programming Language Holds Brighter Prospects In Nigeria  Morfik: For Developing Ajax Web Applications  Page 2
Pages: (1) (2) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.