Wrox Programmer Forums
|
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 25th, 2010, 04:29 PM
Registered User
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 7 - Database open()

In the listing 7-1 code the database open() function returns a MyDBAdapter. I couldn't figure out why this function didn't return void, but then in the section "Saving Your To-Do List" item number 6 this function is defined as
Code:
 public void open ()
. Which method is preferable, or in what scenarios should you use each one? Thanks for any clarification.
 
Old June 16th, 2010, 12:34 AM
Authorized User
 
Join Date: Jun 2010
Posts: 18
Thanks: 0
Thanked 6 Times in 3 Posts
Default

Quote:
Originally Posted by ufl00 View Post
In the listing 7-1 code the database open() function returns a MyDBAdapter. I couldn't figure out why this function didn't return void, but then in the section "Saving Your To-Do List" item number 6 this function is defined as
Code:
 public void open ()
. Which method is preferable, or in what scenarios should you use each one? Thanks for any clarification.
My guess is that in Listing 7-1, the open() method return the object to enable you to do things like db.open().someOtherMethod(). Either way you want to do it should be fine.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch. 11 p. 377 Error when I try to Add New Diagram to my database ceboc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 November 4th, 2009 09:01 AM
Can We open database in different server? por Classic ASP Basics 0 December 18th, 2005 09:25 PM
Cannot open database with password saikrishnan Pro VB Databases 0 August 26th, 2005 01:47 AM
Ch. 15, Fatal Error When Connecting to Database kara333 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 November 30th, 2004 12:37 PM
Attempted to open a database that is already open person747 Access 10 September 3rd, 2004 04:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.