Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 713017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:54:51+00:00 2026-05-14T04:54:51+00:00

I have this function which returns a datatype InetAddress[] public InetAddress [] lookupAllHostAddr(String host)

  • 0

I have this function which returns a datatype InetAddress[]

public InetAddress []
lookupAllHostAddr(String host) throws UnknownHostException {
    Name name = null;

    try {
        name = new Name(host);
    }
    catch (TextParseException e) {
        throw new UnknownHostException(host);
    }

    Record [] records = null;
    if (preferV6)
        records = new Lookup(name, Type.AAAA).run();
    if (records == null)
        records = new Lookup(name, Type.A).run();
    if (records == null && !preferV6)
        records = new Lookup(name, Type.AAAA).run();
    if (records == null)
        throw new UnknownHostException(host);

    InetAddress[] array = new InetAddress[records.length];
    for (int i = 0; i < records.length; i++) {
        Record record = records[i];
        if (records[i] instanceof ARecord) {
            ARecord a = (ARecord) records[i];
            array[i] = a.getAddress();
        } else {
            AAAARecord aaaa = (AAAARecord) records[i];
            array[i] = aaaa.getAddress();
        }
    }
    return array;
}

Eclipse complains that the return type should be byte[][] but when I change the return type to byte[][], it complains that the function is returning the wrong data type. I’m stuck in a loop. Does anyone know what is happening here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:54:51+00:00Added an answer on May 14, 2026 at 4:54 am

    A little research based on lookupAllHostAddr reveals the following:

    The sun.net.spi.nameservice.NameService interface was changed
    for JDK 6 in a way that makes it impossible for Java source code to
    declare a class that can implement either the old or the new version
    (the return type of the lookupAllHostAddr method was changed from
    byte[][] to InetAddress[]).
    Using JDK 6 must fix this!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 503k
  • Answers 503k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If I get it right, is this (click for demo)… May 16, 2026 at 2:52 pm
  • Editorial Team
    Editorial Team added an answer Use get_class(): $this->callbacks[$onAction][] = $callbackMethod; $className = get_class($this); // Call… May 16, 2026 at 2:52 pm
  • Editorial Team
    Editorial Team added an answer Found an awesome extension to the Clip class that lets… May 16, 2026 at 2:52 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i have function which is something like this function multiple_delete($entity1,$entity2,$entity2) { $query = SELECT
I have a user defined function in a SQL Server 2005 database which returns
No coffee. Brain. Not. Functioning. I have this linq query here: Public Function ListAllVisitDates()
I have this great function that parses a field into a pivot table consisting
I have a structure which has 3 identifier fields and one value field. I
i have a partial which contains a jsTree ( jsTree.com ). which i've setup
Is it possible to create an inline lambda using boost which always throws an
I have written the following function to calculate a check digit in R. verhoeffCheck
i have got a function with BOOL return value and 2 input (NSDateComponents *)
This is one of those situations where I've had to pick up and run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.