Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: core java begineer

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default core java begineer

    Hi

    I'm new to java and this blog as well. I started learning core java
    and oops concepts. Right now, i'm working on jxl which deals with
    creation of excel and more on..

    When i see the code to create the workbook it was written as

    WritableWorkbook workbook = Workbook.createWorkbook(file, wbSettings);

    I'm not clear with above snippet and how it is creating the book. I
    browsed the java doc and noticed that Workbook and WritableWorbook are
    Abstract class.

    Also, when i see .class of both.


    /* */ public static WritableWorkbook createWorkbook(java.io.File
    file)
    /* */ throws IOException
    /* */ {
    /* 286 */ return createWorkbook(file, new WorkbookSettings());
    /* */ }

    Please explain why we have WritableWorkbook in method of Workbook and
    what it returns and flow of the alogritham

    Thanks


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: core java begineer

    You need to read up on method definitions and static methods.
    Try this site:
    Trail: Learning the Java Language: Table of Contents (The Java™ Tutorials)

  3. #3
    Member
    Join Date
    Nov 2011
    Posts
    37
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: core java begineer

    Hi,
    You can try to use jxls tag to create excel file , I think that will be more easy.

    Core java
    Last edited by mr.miku; January 11th, 2012 at 07:19 PM.

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: core java begineer

    Both WorkBook and WritableWorkbook classes are extended by Object (the Parent/Root of all classes).
    WorkBook contains a method createWorkBook() which accepts a File type parameter and returns a WritableWorkBook after processing. createWorkBook() is only defined in WorkBook method and as it returns WritableWorkBook so
    WritableWorkBook obj = WorkBook.createWorkBook(File fileObj);
    This will pass fileObj to createWorkBook of WorkBook and get a WritableWorkBook object which will be assigned to WritableWorkBook object.
    I hope it seems clear now.

Similar Threads

  1. Please help me analyze this java core dump on AIX
    By acejun01 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: February 12th, 2014, 05:21 AM
  2. Replies: 10
    Last Post: July 15th, 2011, 01:36 AM
  3. Replies: 1
    Last Post: June 4th, 2011, 11:22 AM
  4. displaying dyanamic data on jsp while core engine is writing it on text file
    By abhyudayaupadhyay in forum File I/O & Other I/O Streams
    Replies: 5
    Last Post: May 24th, 2011, 10:03 AM
  5. Senior Development Manager - Core Java/J2SE - £80-90K + £10K Bonus
    By iNeedJavaGurus in forum Paid Java Projects
    Replies: 0
    Last Post: September 18th, 2009, 10:00 AM