Understanding Java 3D

Alright, so I am quite new to Java. Actually, no I am not 'new' to it... I've been trying to understand it for quite sometime now.
Could someone please correct this if I am wrong:
In order to build applications in Java, I must first use an IDE (netbeans, eclipse, etc.)
Now lets say, I am building a Java Tetris as a way to get familiar with Java. Well now my question is...
For example I am somewhat literate of how game development works on the 'outside' of Java, but now when I come into Java it is like a whole new world.
Now my question is, lets say I want to 'strategically' place some Tetris blocks in the 'dropping' area of Tetris. Is there anyway to actually see it...
For example on game engines you can change the X Y Z axis of an object. Is Java 3D a game engine?
For example, is there a GUI (graphical user interface) to see what I am doing when I am making a game?
Edited by: Triz on Oct 27, 2007 3:56 AM

Actually, Java 3D is not exactly a game engine (if you are looking for a java game engine, try to look at www.jmonkeyengine.com).
Java 3D is a scene graph-based 3D application programming interface (API) for the Java platform. It runs on top of either OpenGL or Direct3D. You can use Java3D to add some good stuff to your applications, and also to create games.
But if you are planning to use or create games with some "special" features, you should try a game engine like jME (jMonkey Engine).

Similar Messages

  • Understanding java multithread programming

    Hi
    I am new to java multithreaded programming.
    In order to understand more about threading mechanism, I would like to first know more about the processors,operating systems.
    Please let me know which book or web site to follow to get a brief but good idea about processors,operating systems that would eventually let me go further with the understanding of multithreading mechanism in java.
    Any input is highly appreciated.
    Thanks in advance.

    Multithread programming is a difficult topic.
    If you protect every access to shared memory by using synchronized methods, you are on the safe side.
    But things are not so simple in the real world.
    Sooner or later, you will face deadlock problems, for instance, and you will learn how to avoid them.
    With more experience, you will be tempted to use some "tricks" that you will find on the internet ( double-locking idiom or things like that ), not understanding why it is dangerous and does not work.
    If you continue your investigation, you will end up with concepts such as memory barrier, race conditions, spinlocks, mutexes, memory model, processor cache and SMP, instruction reordering, and more.
    ( google some of these topics how wide the landscape is )
    In fact, the more you work with it, the more you will have questions about it, and the more you will want to learn about it.
    I also thought that multithreading was easy, three years ago, but it is not true.
    Today, I continue to read books about it.
    Read a lot ! The topic is wide, but the more you know about it, the best you can use it and be confident with it !
    It is worth the effort, as multithreading is here to stay and seems to be everywhere.
    Multithreading is difficult to understand fully, but very interesting.
    Besides, if you write code for server programs ( serving multiple clients ), you must be aware of it.
    Eventually, you will perhaps read this book:
    UNIX(R) Systems for Modern Architectures: Symmetric Multiprocessing and Caching for Kernel Programmers
    by Curt Schimmel
    It is not about java, but if you want to really understand java, you must learn about the underlying layers, and even how a processor works.
    As an example of what not to do and that I saw in an introductory book about java, the following code is full of bugs and does not work !
    You cannot stop the looping thread B by just setting and testing a global flag like that.
    static int stopflag = 0;
    Thread A:
    public void stop_B_thread()
    stopflag = 1;
    Thread B:
    while (stopflag == 0)
    // do some job

  • Do week-long java courses help to understand java &  get a job?

    i tried searching for this topic before posting, but "courses" "classes" & "instruction" come up with a lot that has nothing to do with the topic at hand. :)
    like many others, i'm teaching myself out of a book (Deitel). so far i've been able to understand the material and create programs based on the exercises. however, i'm now into the meat of OOP with superclass, subclasses, how they interact and the like and i'm having a rough go of it. i can diagram and understand the abstract concept, but when i'm faced with an actual program example i have a difficult time following the interactions between classes.
    i'm considering taking one of those 5 day classes, but am wary of how much they will actually be able to cover in detail (not to mention the $$). has anyone here taken one of those classes and found them to be of great benefit to learning the OOP portion of Java? did it give you enough understanding to obtain an entry-level job?
    btw, i'm doing a pro bono project for a small company to get some real world experience. (i've heard that suggestion many times in regards to obtaining one's "experience" w/o a job)
    thank you all very much for your help.

    I took a week long course to learn Java. It worked I did learn the basics of Java but I did already know how to program in C and VB at the time. I found the AWT section of the class to be very valuable,cosidering I mostly write GUI. And the concepts of AWT mostly all apply to swing so that didn't set me back at all. Depending on the school it may help you to understand OOP. But be careful because most schools progress the class at the skill level of the majorty. So if you have 15 people in the class and 9 of them know nothing about programing your probably going to spend the week learning what a variable and a while loop do, you all pay the same tuition and they would rather 6 of you leave then 9 of you leave. If you have some prior programming knowledge I would recomend finding a class that caters to that.

  • Trying to understand java

    Trying to understand corba
    please tell me what the inout in this coode means:
    boolean book_search(inout b_item book, inout client olvas) raises (BookNoAvail)
    The type of parameter passing in Java is that it makes a copy of the parameter and themn in method somthing happens??
    So which one is it out of the two: pass by reference and pass by value?

    please tell me what the inout in this coode means:A parameter that supplies input as well as accepts output is an INOUT parameter.

  • Trying to understand Java servers

    I have been trying to get an understanding of Java ServerSockets and have hit a dead-end here.
    This is just the first part of the server code and I can't see what the compiler does not like about this. The compiler dies and puts the arrow on the "a" of the word accept. I have looked at lots of different examples of server codes and no 2 resources have the same way of doing it.
    Does anyone have any idea first of all what is wrong with mine below and
    what it should be?
    thanks
    George Mizzell
    import java.net.*;
    import java.io.*;
    public class STServer {
    public static void main (String[] args) throws IOException {
    if (args.length != 1) {
    System.err.println("Oops, invalid parameters");
    return;
    Socket client = accept (Integer.parseInt (args[0]));
    try {

    I apologize for not including the rest of the code. As a newbie, I was thinking that the code processed sequentially and the lines after the problem did not play a role in causing the compile error. Here is the complete listing.
    Thanks for reading it and pointing this out
    import java.net.*;
    import java.io.*;
    public class STServer {
    public static void main (String[] args) throws IOException {
    //test for correct number of parameters - ie must enter a port number
    if (args.length != 1) {
         System.err.println("Oops, invalid parameters");
         return;
         Socket client = accept (Integer.parseInt (args[0]));
         try {
              InputStream in = client.getInputStream ();
              OutputStream out = client.getOutputStream ();
              out.write("Welcome to the Echo Server.\r\n".getBytes("latin1"));
              PrintWriter p;
              PrintWriter ToClient = new PrintWriter(client.getOutputStream());
              String UserName = System.getProperty("user.name");
              String sendtext;
              sendtext = "You are now connected to " + UserName + ".\r\n";
              out.write ("You are now connected to the Echo Server.\r\n"
         .getBytes ("latin1"));
              out.write (sendtext.getBytes ("latin1"));     
              int x;
              while ((x = in.read ()) > -1)
         out.write (x);
              } finally {
                   System.out.println ("Closing");
                   client.close ();          
              System.out.println ("Starting on port " + args[0]);
              System.out.println ("Waiting");
              System.out.println ("Accepted from " + client.getInetAddress ());
              EchoServer5.close ();
         } catch (IOException e) {
              System.out.println("Port did not accept connection:" +
                   Integer.parseInt (args[0]));
         System.exit(-1);
    }

  • Trying to understand Java Sockets

    First, I have been able to find enough examples to get off ground zero and now I need a little help understanding what I have found.
    Secondly, I have a problem that i need a little help on.
    First - as I understand it the // indicates a comment and then I found a snippet that helped me get what I wanted but I can't understand this
         } catch(IOException e) {
         e.printStackTrace();
         // System.exit(3);
    return;
    in this is example is the //System.exit(3) doing anything or is it just intended as a comment? What does the return do? Where does it return to?
    Secondly - the problem. In setting up the socket, I am trying to trap for a few common errors such as parameter not entered on the command line, invalid host, invalid port, or port not listening, etc. Some of these I have been able to figure out because people have examples that help me figure out how to use it but others don't. Here is my code snippet so far. I am trying to explore the PortUnreachableEception class and haven't had any success at all. Where would it go and what would be the right way to use it in this scenario?
    Thanks
    George Mizzell
    import java.io.*;
    import java.net.*;
    public class GetBoth3{
    public static final int GetDayTimePort = 13;
    public static final int GetQuotePort = 17;
    public static void main(String[] args){
         if (args.length != 1) {
         System.err.println("Oops, no address to find");
         // System.exit(1);
         return;
         InetAddress address = null;
         try {
         address = InetAddress.getByName(args[0]);
         } catch(UnknownHostException e) {
         e.printStackTrace();
         // System.exit(2);
    return;
         Socket getDateTime = null;
         try {
         getDateTime = new Socket(address, GetDayTimePort);
         } catch(IOException e) {
         e.printStackTrace();
         // System.exit(3);
    return;
         InputStream in = null;
         try {
         in = getDateTime.getInputStream();
         } catch(IOException e) {
         e.printStackTrace();
         // System.exit(5);
    return;
         BufferedReader reader = new BufferedReader(new InputStreamReader(in));
         String line = null;
         try {
         line = reader.readLine();
         } catch(IOException e) {
         e.printStackTrace();
         // System.exit(6);
    return;
         System.out.println("The current date and time on " + address + " is " + line);
         // System.exit(0);
    return;
    } // GetBoth3

    Starting with your first question:
    } catch(IOException e) {
    e.printStackTrace();
    // System.exit(3);
    return;
    System.exit(3) is commented out there, it is not doing anything. At first it seems confusing because... why write a line of code, then comment it out? Does it tell us anything? What's going on? The reason that it's commented out is either because the original programmer put System.exit(3) there and decided to use return instead, but didn't want to forget what the original line of code was, or, he wanted to suggest to the reader that perhaps System.exit(3) may be more appropriate than return. Sometimes, when I am debugging an application I wrote, I comment out lines of code without deleting them, so that I won't forget what they were. Or, I comment out my debugging code so that I can easily use it again later without it being compiled into release versions.
    So, to answer your question. The //System.exit(3) does nothing, it is just intended as a comment. Return causes the flow of execution to jump out of the method that it is currently in and return to the calling method. For example:
        public static void main (String[] args) {
            System.out.println("Calling poo(true):");
            poo(true);
            System.out.println("Calling poo(false):");
            poo(false);
            System.out.println("Sorry, no more poo.");
        public static void poo (boolean do_return) {
            System.out.println("First line.");
            if (do_return) return;
            System.out.println("Second line.");
        };The output should be:
        Calling poo(true):
        First line.
        Calling poo(false):
        First line.
        Second line.
        Sorry, no more poo.I don't know if any of that works, I just typed it here. But, you should be able to see what I'm getting at. If do_return is true in poo, then the return statement causes poo to RETURN to main (which is the function that poo was called from) before printing "Second line.".
    By contrast, if I would have put System.exit(3) in poo() instead of return, then after calling poo(true) and printing "First line.", the program would have exited back to the system, and "Calling poo(false):" would never have been printed.
    So, in the code that you typed, in GetBoth3.main:
    if (args.length != 1) {
    System.err.println("Oops, no address to find");
    // System.exit(1);
    return;
    Putting a commented out //System.exit(1) does nothing in your program, it's just a comment. When ever you use "return" from main, since nothing called main, returning from main just exits the program and returns to the system.
    So:
    1) Use return in a method to stop executing the rest of the code in the method, and exit the method.
    2) Use return in main() to end the program. This is the same as typing System.exit(0) in main.
    3) Use System.exit(code) anywhere in your program to end the program at any given time.
    Note that the following code:
        public myMethod () {
            // Do some things...
            if (some_expression == true) return;
            // Do some more things....
        };is functionally equivalent to:
        public myMethod () {
            // Do some things...
            if (some_expression != true) {
                // Do some more things...
        };But the first one is a bit easier to read, esp. when your code gets more complex.
    Here is my code snippet so far. I am trying to explore the
    PortUnreachableEception class and haven't had any success at all.
    Where would it go and what would be the right way to use it in this
    scenario?
    If you look at the class derivation tree at the top of the javadoc page for PortUnreachableException, you see that one of the classes it is derived from is IOException. Whenever you use a try...catch block, not only does "catch" catch whatever type of exception you specify, but it also catches all exception classes DERIVED from the one that you specified. So, by catching an IOException, you are, in fact, also catching PortUnreachableExceptions. The problem is, in this code...
        try {
            getDateTime = new Socket(address, GetDayTimePort);
        } catch (IOException iox) {
            System.out.println("Error: " + iox);
            System.exit(0);
        };...although you are catching an IOException (and PortUnreachableException's) as well, you have no clean way of differentiating between PortUnreachableException and any other IOException in your code (except by using instanceof, which I can explain later if you want, but it's not really the preferred way to do it in this case).
    You could try the following exception handler instead:
        try {
            getDateTime = new Socket(address, GetDayTimePort);
        } catch (PortUnreachableException px) {
            // Stuff
        };But then you will get an uncaught exception compiler error, because the Socket constructor throws an IOException, and you are only catching a subset of exceptions derived from IOException, so any other exceptions besides PortUnreachableException (and the exceptions derived from PortUnreachableException) will remain uncaught by your exception handler.
    The solution is to catch both, like so:
        try {
            getDateTime = new Socket(address, GetDayTimePort);
        } catch (PortUnreachableException px) {
            System.out.println("Invalid port specified!");
            System.exit(some_exit_code);
        } catch (IOException iox) {
            System.out.println("Error creating socket: " + iox);
            System.exit(some_exit_code);
        };Note that the order in which your catch statements appear is important. If an exception is thrown in the try block, the program will go to each catch block in order, and execute the first one that applies. So, since PortUnreachableException is derived from IOException, and can therefore be caught by IOException catch blocks, the following code will not do what you want:
        try {
            getDateTime = new Socket(address, GetDayTimePort);
        } catch (IOException iox) {
            System.out.println("Error creating socket: " + iox);
            System.exit(some_exit_code);
        } catch (PortUnreachableException px) {
            System.out.println("Invalid port specified!");
            System.exit(some_exit_code);
        };Since the IOException catch block appears first, and since PortUnreachableExceptions can be caught be IOException catch blocks, then the IOException catch block code will execute, not the PortUnreachableException catch block code.
    Also, you may be confused about a few other things I threw in my code:
    First of all, "some_exit_code" is whatever exit code you want. The exit code you use does not directly affect your application in any way. Exit codes are useful if you say, spawn your application from another process, and then you want the spawning process to be able to know some information about how your application exited. I can explain that better too, if you want.
    Secondly, I used System.exit() instead of return in the main() exception handlers just so that I could control the exit code of the application. If you have no use for exit codes, just use return from main. Also, keep in mind, if you use System.exit() in ANOTHER method (not main) instead of return, then you will exit the program rather than returning from the method.
    Also, System.out.println("Error: " + iox) will print a good amount of detail about the IOException iox. Although it won't be as useful as printStackTrace() to you, the developer, it will be more readable than printStackTrace() to the common user.
    As an aside, relating to System.out.println, if you define the following method in one of your classes:
        public String toString () {
            return "A string representation of this class.";
        };Then you can use System.out.println(MyClass), or String i = "Description: " + MyClass to print readable information about MyClass. I didn't explain that well so here is an example:
        // OddEven.java
        public class OddEven {
            protected int i;
            public OddEven (int i) {
                this.i = i;
            public String toString () {
                if ((i % 2) == 0) return "even number";
                else return "odd number";
        // Whatever.java
        public class Whatever {
            public static void main (String[] args) {
                OddEven o = new OddEven(31);
                OddEven e = new OddEven(100);
                System.out.println("OddEven o: " + o);
                System.out.println("OddEven e: " + e);
        };That should work, haven't tested it though. But basically, any time an Object gets converted to a String (for example, by passing an Object to a function expecting a String, or by use '+' to concatenate an Object to a String), the toString() method of that Object is called, and the return value is used as the String.
    That example should give you another idea about what return does, too.
    If you want me to explain instanceof, exit codes, or class derivation and inheritance, lemme know.
    Hope any of this helps.
    Jason Cipriani
    [email protected]
    [email protected]

  • Understanding Java Class Accessibility

    I don't understand what makes a Java library class accessible by a Java applet. If an applet has an import statement that imports, say, java.util.TreeMap, then when a web browser accesses a web page containing that applet, does it download the Java code for the TreeMap class at that time, and if so, does that mean that you have to package the TreeMap class as part of your applet class code somehow? Or, must the TreeMap class be installed as part of the Java virtual machine on the computer that is running the browser? If the latter, what determines whether or not the typical computer will have the TreeMap class available? Is the TreeMap class available on a PC running Windows XP, using the Java virtual machine that Microsoft supplies? Where can I read about this sort of thing? How can I determine what classes I can safely use if I want my applet to run on both Windows and Macs?

    "I don't understand what makes a Java library class accessible by a Java applet. If an applet has an import statement that imports, say, java.util.TreeMap, then when a web browser accesses a web page containing that applet, does it download the Java code for the TreeMap class at that time, and if so, does that mean that you have to package the TreeMap class as part of your applet class code somehow? "
    No.
    "Or, must the TreeMap class be installed as part of the Java virtual machine on the computer that is running the browser?"
    Yes
    "If the latter, what determines whether or not the typical computer will have the TreeMap class available?"
    The version of the Java Runtime environment/Plug-in installled on the PC
    "Is the TreeMap class available on a PC running Windows XP, using the Java virtual machine that Microsoft supplies?"
    No which why some people don't use the newer Java classes or Swing when they write applets.
    "Where can I read about this sort of thing? How can I determine what classes I can safely use if I want my applet to run on both Windows and Macs?"
    http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/using_tags.html

  • Understanding java.lang.RuntimePermission

    I was utilizing a script I found online which allows me to call OS commands and PERL scripts from PL/SQL, using JAVA as an interface. Before things would work, the following DBMS_JAVA calls were necessary.
    I think I get the last one (file permissions) but I don't understand the purpose of the first 2.
    EXEC dbms_java.grant_permission('SHARED', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC dbms_java.grant_permission('SHARED', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    EXEC dbms_java.grant_permission('SHARED', 'SYS:java.io.FilePermission', '/bin/sh', 'execute');
    I mainly concerned as they look like they grant read/write privileges on everything (...'writeFileDescriptor', ''). java.sun.com warns that "[readFileDescriptor] ... would allow code to read the particular file associated with the file descriptor read. This is dangerous if the file contains confidential data", and that "[writeFileDescriptor]...allows code to write to a particular file associated with the descriptor. This is dangerous because it may allow malicious code to plant viruses or at the very least, fill up your entire disk."
    So I'm concerned,
    Chuck

    We have since taken it that step further, and revoked access to /bin/sh, and granted it to a test PERL script /test/scripts/list_dir.pl
    What is strange is that when I went out to the operating system today (Sep 16) and issued a 'ps -ef' I found the following:
    [oracle@ora4 oracle]$ ps -ef | grep 5994
    oracle 5994 1 0 Sep15 ? 00:10:52 ora_s001_dev
    oracle 11214 5994 0 Sep15 ? 00:00:00 [list_dir.pl <defunct>]
    oracle 11327 5994 0 Sep15 ? 00:00:00 [ls <defunct>]
    oracle 16866 14478 0 07:56 pts/0 00:00:00 grep 5994
    The processes are hanging around (I started with a more simple 'ls' just to see if this would even work - so it's there too).
    Why would that be?
    If it helps, here is the java code and the PL/SQL wrapper that I found at orafaq.com:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1) {
    finalCommand = new String[4];
    finalCommand[0] = "C:\\winnt\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    } else {                              // Linux or Unix System
    finalCommand = new String[3];
    finalCommand[0] = "/bin/sh";
    finalCommand[1] = "-c";
    finalCommand[2] = command;
    // Execute the command...
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    // Capture output from STDOUT...
    BufferedReader br_in = null;
    try {
    br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("stdout: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_in.close();
    } catch (IOException ioe) {
    System.out.println("Error printing process output.");
    ioe.printStackTrace();
    } finally {
    try {
    br_in.close();
    } catch (Exception ex) {}
    // Capture output from STDERR...
    BufferedReader br_err = null;
    try {
    br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("stderr: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_err.close();
    } catch (IOException ioe) {
    System.out.println("Error printing execution errors.");
    ioe.printStackTrace();
    } finally {
    try {
    br_err.close();
    } catch (Exception ex) {}
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    show errors
    rem -----------------------------------------------------------------------
    rem Publish the Java call to PL/SQL...
    rem -----------------------------------------------------------------------
    CREATE OR REPLACE PROCEDURE host (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    /

  • Understanding Java Thread Dump

    Hi,
    I was looking at the following thread dump
    Full thread dump Java HotSpot(TM) Server VM (11.0-b16 mixed mode):
    "pool-3-thread-1428" prio=10 tid=0x72b83800 nid=0x60ef waiting on condition [0x73318000..0x73318fb0]
    java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <0x98983260> (a java.util.concurrent.SynchronousQueue$TransferStack)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
    at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
    "MergeTask" daemon prio=10 tid=0x09454c00 nid=0x60e7 waiting for monitor entry [0x65106000..0x65106f30]
    java.lang.Thread.State: BLOCKED (on object monitor)
    at org.apache.log4j.Category.callAppenders(Category.java:201)
    - waiting to lock <0x96d90bb8> (a org.apache.log4j.spi.RootLogger)
    at org.apache.log4j.Category.forcedLog(Category.java:388)
    at org.apache.log4j.Category.log(Category.java:853)
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
    I can see that 0x98983260 and 0x96d90bb8 are memory addresses of condition object and lock object respectively (I hope ti. But I was puzzled with [0x73318000..0x73318fb0] and [0x65106000..0x65106f30].
    What do these memory ranges indicate? Is there any documentation related to thread dump?
    In OpenJDK source code I can see following comment. But I did not understand what it means.
    // print guess for valid stack memory region (assume 4K pages); helps lock debugging
    st->print_cr("[" INTPTR_FORMAT "]", (intptr_t)last_Java_sp() & ~right_n_bits(12));
    Thanks,
    Unmesh

    Thread Dump Analysis On AIX Platform:
    http://middlewaremagic.com/weblogic/?p=4348

  • Understanding JAVA IO

    I am looking through the OREILLY JAVA IO Book and am having some difficulty undersanding Unput and OutputStreams.
    I quote:
    "The fundamental method of InputStream class is read(), which reads a single unsigned byte of data and returns the integer value of the unsigned byte"
    What is really going on here. What is meant by reading a single unsigned byte of data, or in the case of OutputStreams, what is meant by writing a single unsigned byte of data.
    I know this may seem quite clear to you, but I realy have problems undersanding this. What exactly is the compiler doing?
    This is currently my understanding of streams..Tell em where I am wrong:
    Streams are defined as "an ordered sequence of bytes of undetermined length"
    The read method of input streams which returns an int
    really creates an ordered sequence of bytes from an external source and on the jvm allocates space to save these bytes as type int.
    The write method of outputstreams creates an ordered sequence of bytes from a space on the jvm which is saved as type and int makes it available to an external source.

    These links may help:
    http://java.sun.com/docs/books/tutorial/reallybigindex.html
    http://java.sun.com/docs/books/tutorial/essential
    http://java.sun.com/docs/books/tutorial/essential/io

  • Understanding Java Binary Incompatibility

    Hi folks,
    I'm just reading up about binary imcompatibility for a software engineering exam and having a hard time understanding the notes. Is anyone able to provide an understandable definition. I understand that the problem comes from having different classes at compile time than at runtime, but I'm trying to understand why this affects Java and not other languages, such as C.
    any input is much appreciated

    the simplest example I can think of is when a class changes its interface between versions. so you have
    1) MyClass.java is compiled to MyClass.class with a public method a()
    2) Client.java is compiled to Client.class that calls method a()
    3) MyClass.java is recompiled without Client.java present, having removed a() and replaced it by b()
    4) Client.class is run, the new MyClass.class is loaded and the JVM detects that a() is not found in MyClass.class's definition. This is not necessarily reported until Client attempts to call a()
    http://java.sun.com/docs/books/jls/second_edition/html/binaryComp.doc.html#44952
    asjf

  • Understanding Java superclass hierarchy through System objects and methods

    I wanted to see if I can manipulate datastreams manually rather than relying on classes.
    I knew that System.in was an InputStream object so it must use the said methods such as System.in.read()
    I made a program for it. It gave me an IOException. When I went to "catch" the exception it said cannot find symbol IOException. This was fixed by import java.io.*;
    I find that very weird conceptually. First System.in is wrapped by the System class. I have no need to import java.io.*; to use System so why would I need to import it in this case. Second, when I use Scanner to read in from System.in I do need to import java.io.*, yet I'm pretty sure it makes the same method calls to System.in I make, no?
    //import java.io.*;
    public class streams
         public static void main( String[] args )
              try {
                   System.out.printf( "%c\n", System.in.read() );
              } catch (IOException e) {
                   System.err.println( "IOException error" );
    }

    Importing does not make classes available. All it does is tell the compiler that when you say "IOException," it is actually shorthand for "java.io.IOException." The import applies only to the class in which it is declared, and only at compile time. It is gone once you compile your class. It does not show up in the .class file, and has no effect whatsoever at runtime.

  • Suggest tutorial or article for understanding Java Class Loaders

    I want to learn about the Java Class Loaders, from basics to writing custom Class Loaders. Please suggest good material for the same.

    [http://www.javalobby.org/java/forums/t18345.html]
    [http://java.sun.com/developer/onlineTraining/Security/Fundamentals/magercises/ClassLoader/help.html]
    [http://publib.boulder.ibm.com/infocenter/javasdk/v1r4m2/index.jsp?topic=/com.ibm.java.doc.diagnostics.142/html/id1100.html]
    [http://onjava.com/pub/a/onjava/2005/01/26/classloading.html]
    [http://java.sun.com/developer/technicalArticles/Networking/classloaders/]
    [http://www.informit.com/articles/article.aspx?p=1187967]
    This should keep you busy.
    Usually learning about classloader's is coupled with learning to develop with Java's security features and therefore I think most Java security books dedicate a chapter for it.

  • Not understanding java updates

    I know I've posted something similar to this before, but I just can't get the picture. So again, if you write a program in lets say java 2 update 13, which is the current one, and then they release the update 14 and you get that version, wouldn't the program that you made not work anymore if they had updated one of the classes or functions that you used?

    brown16b wrote:
    I know I've posted something similar to this before, but I just can't get the picture. So again, if you write a program in lets say java 2 update 13, which is the current one, and then they release the update 14 and you get that version, wouldn't the program that you made not work anymore if they had updated one of the classes or functions that you used?There's a "contract" that no changes in future versions will "break" existing code.
    This "contract" is strong but on occasion there will be "breaking changes". This is very rare though and when it happens there will be plenty of information about what to do.
    In fact the "contract of no breaking changes" is so strong that many consider it a bottleneck for the proper development of Java.

  • Need a little help understanding java and /etc/profile.d/***

    A few days ago I installed jre-6u10-1 and jdk-6u10-1 via pacman on my desktop machine; for the web plugin.
    The packages installed in /opt/java/...
    I later installed jedit, via pacman.  It runs fine as it (/usr/bin/jedit) is hardcoded to look for java in /opt/java/...
    Today, I installed jedit (pacman -S jedit) on my laptop which did not have any java installed.
    Pacman automatically installed openjdk6-jre-6u10-1 as a prerequisite.
    Openjdk installs to /usr/lib/jvm/..., therefore jedit fails as /opt/java... is non-existent.
    I suppose Sun's java and the opensource version are installed in different locations to keep from overwriting each other.
    I could easily edit /usr/bin/jedit to point to the openjdk location and it would work.
    But I'm a little uncertain of the following three files:
    Sun's java installs /etc/profile.d/jre.sh and /etc/profile.d/jdk.sh
    which do the following (respectively):
    export PATH=$PATH:/opt/java/jre/bin
    if [ ! -f /etc/profile.d/jdk.sh ]; then
    export JAVA_HOME=/opt/java/jre
    fi
    and
    export J2SDKDIR=/opt/java
    export PATH=$PATH:/opt/java/bin
    export JAVA_HOME=/opt/java
    The opensource java package installs /etc/profile/openjdk6.sh
    which does the following:
    export J2SDKDIR=/usr/lib/jvm/java-1.6.0-openjdk
    export J2REDIR=$J2SDKDIR/jre
    export JAVAHOME=/usr/lib/jvm/java-1.6.0-openjdk
    #export CLASSPATH="${CLASSPATH:+$CLASSPATH:}$J2SDKDIR/lib:$J2REDIR/lib"
    So I am left with a few options:
    1.  edit /usr/bin/jedit to look in the opensource location
    2.  edit /usr/bin/jedit to use the $J2SDKDIR variable when looking for java
    3.  update the $PATH via /etc/profile.d/openjdk6.sh to include java's location
    I think all three methods would work, but I have limited experience with java and would like some input as to which proposed solution is the best going forward.
    What methods are other java apps using to find java?
    Thanks
    (edit: more descriptive title)
    Last edited by cjpembo (2008-11-11 04:24:47)

    I think the best option would be to ask the maintainer to modify the jedit-bin file, and have it launch
    $J2SDKDIR/bin/jre/java cp $CP -Djedit.home="/usr/share/jedit" -mx${JAVA_HEAP_SIZE}m org.gjt.sp.jedit.jEdit $@
    That way, it should work with both java implementations (completely untested, btw.)

Maybe you are looking for

  • How do I move music from previous iphone to a new one?

    Can't seem to work out how to get music from previous iphone on new one? Also have changed laptop as well. Should I be able to do it via home sharing?

  • Limit nbr of rows in a query

    Dears, I found 2 solutions to limit the number of rows a query can return: - the first one is making use of a condition in the query itself based on RCOUNT - a second one is setting the parameter ResultRowLimit in the instanceconfig file. Now I was w

  • MacBook Pro - Broken Superdrive

    Hi all, The superdrive on my MacBook Pro (15", Early 2008) is broken, discs don't spin properly, I think because I always pick it up with one hand at the corner and I've bent the whole thing. Silly me. Anyway, seeing as I'm out of warrantly now, I wa

  • Can't retrieve approval status in Globally Reusable Workflow (Approval - Sharepoint 2010)

    For day's i am trying to implement the following in one of the standard, out of the box, Globally Reusable Workflow with Sharepoint Designer 2010: If Current Item:Approval Status not equals 0:#Approved Start Approval Workflow Task process on Current

  • TRANSPORTABLE TABLESPACE IN 8.1

    제품 : ORACLE SERVER 작성날짜 : 2004-08-16 Oracle8i에서는 tablespace단위로 그 구성 datafile들을 옮겨서 다른 database에 연결시켜 사용할 수 있는 기능이 제공된다. SCOPE 8i~10g Standard Edition 에서는 Import transportable tablespaces 기능만이 지원이 됩니다. 유용성 1. 전사적 정보시스템내에서 대량의 data의 흐름이 필요할 경우, - 예를 들어