|
|
|
|
|
|
|
Re: Contextual Method- & Object- list & support during typing of codes? [message #1768396 is a reply to message #1768390] |
Tue, 18 July 2017 06:05  |
Eclipse User |
|
|
|
The problem, Dr. Merks, is that Oracle distributes only rpm or tar.gz version. I had downloaded the earlier version stated. Inside the zip file is the rpm version. Debian or Debian based Linux flavours use .apt extensions.
I will download the tar.gz version and see what form it contains internally.
Thank you for your guidance.
...
[Later]
Used the link
Installation of the 32-bit JDK on Linux Platforms
Quote:This procedure installs the Java Development Kit (JDK) for 32-bit Linux, using an archive binary file (.tar.gz).
These instructions use the following file:
jdk-8uversion-linux-i586.tar.gz
Download the file.
Before the file can be downloaded, you must accept the license agreement. The archive binary can be installed by anyone (not only root users), in any location that you can write to. However, only the root user can install the JDK into the system location.
Change directory to the location where you would like the JDK to be installed, then move the .tar.gz archive binary to the current directory.
Unpack the tarball and install the JDK.
% tar zxvf jdk-8uversion-linux-i586.tar.gz
The Java Development Kit files are installed in a directory called jdk1.8.0_version in the current directory.
Delete the .tar.gz file if you want to save disk space.
...
[Still Later]
Yes, the Javadoc in Eclipse now shows the information on the objects! Need to invest time on it and learn more about it.
I have one query, Dr. Merks.
I take the code I have written:
import java.util.Arrays;
public class HW_import_java_util_Arrays {
public static void main(String[] args) {
System.out.println("Hello World!");
System.out.println(Arrays.toString(args));
}
}
Let us analyse the code line:
System.out.println(Arrays.toString(args));
I progressively hold the mouse cursory on System. I get on Javadoc some relevant information:
java.lang.System
java.lang.System
The System class contains several useful class fields and methods. It cannot be instantiated.
Among the facilities provided by the System class are standard input, standard output, and error output streams; access to externally defined properties and environment variables; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.
I right click and find options Open Attached Javadoc Shift+F2
When I click on the option I find the html format in the Java perspective with information on System. [Snapshot attached]

Then subsequently, I reach .out. :
The Javadoc says:
PrintStream java.lang.System.out
PrintStream java.lang.System.out
out
public static final PrintStream out
The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user.
For simple stand-alone Java applications, a typical way to write a line of output data is:
System.out.println(data)
See the println methods in class PrintStream.
Then as I reach .println( , I find:
void java.io.PrintStream.println(String x)
void java.io.PrintStream.println(String x)
println
public void println(String x)
Prints a String and then terminate the line. This method behaves as though it invokes print(String) and then println().
Parameters:
x - The String to be printed.
Next, I move into (Arrays. It says:
java.util.Arrays
java.util.Arrays
This class contains various methods for manipulating arrays (such as sorting and searching). This class also contains a static factory that allows arrays to be viewed as lists.
The methods in this class all throw a NullPointerException if the specified array reference is null, except where noted.
The documentation for the methods contained in this class includes briefs description of the implementations. Such descriptions should be regarded as implementation notes, rather than parts of the specification. Implementors should feel free to substitute other algorithms, so long as the specification itself is adhered to. (For example, the algorithm used by sort(Object[]) does not have to be a mergesort, but it does have to be stable.)
This class is a member of the Java Collections Framework.
I further move right to toString(. It says:String java.util.Arrays.toString(Object...
String java.util.Arrays.toString(Object[] a)
toString
public static String toString(Object[] a)
Returns a string representation of the contents of the specified array. If the array contains other arrays as elements, they are converted to strings by the Object.toString() method inherited from Object, which describes their identities rather than their contents.
The value returned by this method is equal to the value that would be returned by Arrays.asList(a).toString(), unless a is null, in which case "null" is returned.
Parameters:
a - the array whose string representation to return
Returns:
a string representation of a
Finally, I reach (args), for which there is no information on the javadoc, save this:String...
String[] HW_import_java_util_Arrays.main(String[]).args
The information is not intuitive to the mind immediately, Sir!
Moved to a Separate ThreadHow do I link these separate informations on the APIs available in the Javadoc or Java API index?
There are no explicit examples on how to link and use them in a meaningful way within a program.
Let me now approach the problem from the other side. Suppose that I have these four APIs within the http://docs.oracle.com/javase/8/docs/api/index.html
- PrintStream java.lang.System.out
- void java.io.PrintStream.println(String x)
- java.util.Arrays
- String java.util.Arrays.toString(Object[] a)
What I mean is that, if I come across these above four API definitions/descriptions independently, I wouldn't be in a position to know that they could be weaved together into a meaningful form:
System.out.println(Arrays.toString(args)); unless I have specific examples.
This is what I need to know:
How to be able to weave together terms from the list: http://docs.oracle.com/javase/8/docs/api/index.html into code lines that work in a meaningful way?
Made into a separate thread for your attention and suggestion: How to combine separate APIs in meaningful ways?
[Updated on: Wed, 19 July 2017 12:00] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06542 seconds