Java KeyWord Explanation

Hi there!
I have to prepare a report, where I present a simple Codeexample of an JavaBean-Implementation. My problem is, that I am not very familar to Java.
Now I need a source, where to consult the meaning of the basic keywords.
i.e., if I have a code-line like
public class MyClass extends SimpleBeanInfo
I need a short explanation for the Keywords and what they are for (public, class, extends).
I hope, you know such a library.
Thanks in advance,
Frank

You'll find the above mentioned langspec from here: http://java.sun.com/docs/books/jls/second_edition/html/jTOC.doc.html
Chapter 8 seems to have stuff related to the class declaration. But the meaning of them is given quite implicitely... so let's look it up in google: http://www.google.com/search?q=java+keywords
the third hit looks promising, doesn't it?

Similar Messages

  • Which java keyword cannot be used inside the body of a static method?

    Which java keyword cannot be used inside the body of a static method, but may be used without problems in a non-static method?

    But javac doesn't complain. So I was not partially wrong -- I was completely wrong.It's still better not to use the "this", though. When you explictly reference a static member via an instance reference (theFoo.bar or this.bar, as opposed to Foo.bar) the JLS requires a check that the reference is non-null. Clearly "this" is always non-null, but javac still puts in half of the check. Take the simple class public class Test {
        static int field;
        public void setField(int i) {this.field=i;}
        public void staticSetField(int i) {field=i;}
    } and observe the bytecodes produced: $ javap -c Test
    Compiled from "Test.java"
    public class Test extends java.lang.Object{
    static int field;
    public Test();
      Code:
       0:   aload_0
       1:   invokespecial   #1; //Method java/lang/Object."<init>":()V
       4:   return
    public void setField(int);
      Code:
       0:   aload_0
       1:   pop
       2:   iload_1
       3:   putstatic       #2; //Field field:I
       6:   return
    public void staticSetField(int);
      Code:
       0:   iload_1
       1:   putstatic       #2; //Field field:I
       4:   return
    }The JIT will get rid of it, but you may as well avoid the waste in the first place. (And if you really do want to check that the reference is non-null, do the check explicitly so that maintainers know it's intentional).

  • Can we give a class name by java keyword ?

    can we give a class name by java keyword ?e. can we create a class call "for" / "if" anyhow ? Is there some way to create such kind of classes .. Is is possible with some other java like language.. & if there is any language & how one can embed the script/language in java ..
    Please let me know
    Regards

    can we give a class name by java keyword ?e. can we
    create a class call "for" / "if" anyhow ? Is there
    some way to create such kind of classes .. Is is
    possible with some other java like language.. & if
    there is any language & how one can embed the
    script/language in java ..
    I give up - why would you want to?

  • Java error explanation

    Any idea which direction I should head to learn more about this error?
    # HotSpot Virtual Machine Error, Internal Error
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    # Java VM: Java HotSpot(TM) Server VM (1.4.1_07-b02 mixed mode)
    # Error ID: 434F4E43555252454E542D41524B335745455027454E45524154494F4E0E4350500B97 FF
    # Problematic Thread: prio=1 tid=0x2d340 nid=0x1 runnable
    Abort - core dumped
    in this environment.

    The instructions for what to do are in the error message. Is that the entire text of the message?

  • Java Code explanation

    Iam new in java and on going learning, iam puzzle with this code, based on this code why the value x1 change when value x2 is set to different time? please do explain to me.. TQ
    class MyTime {
         public static void main(String[] args) {
              Time x1, x2;
              x1 = new Time();
              x1.setTime(1, 00);
              x2=x1;
              System.out.print("x1: ");
              x1.whatTime();
              System.out.println();
              System.out.print("x2: ");
              x2.whatTime();
              System.out.println();
              x2.setTime(3, 00);
              System.out.print("x1: ");
              x1.whatTime();
              System.out.println();
              System.out.print("x2: ");
              x2.whatTime();
              System.out.println();
    }

    What you have to realiuse is that x1 and x2 are not Time objects. They are just pointers that point to the same Time object. So for example say you have two people called x1 and x2 standing and pointing at stuff written on a blackboard, the same blackboard. So if you get person x1 to make any changes to what is written on the blackboard, person x2 is still pointing to the same stuff on that same blackboard.

  • Question about the java doc of String.intern() method

    hi all, my native language is not english, and i have a problem when reading the java doc of String.intern() method. the following text is extract from the documentation:
    When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned.
    i just don't know the "a reference to this String object is returned" part, does the "the reference to this String" means the string that the java keyword "this" represents or the string newly add to the string pool?
    eg,
    String s=new String("abc");  //create a string
    s.intern();  //add s to the string pool, and return what? s itself or the string just added to string pool?greate thanks!

    Except for primitives (byte, char, short, int, long, float, double, boolean), every value that you store in a variable, pass as a method parameter, return from a method, etc., is always a reference, never an object.
    String s  = "abc"; // s hold a reference to a String object containing chars "abc"
    foo(s); // we copy the reference in variable s and pass it to the foo() method.
    String foo(String s) {
      return s + "zzz"; // create a new String and return a reference that points to it.
    s.intern(); //add s to the string pool, and return what? s itself or the string just added to string pool?intern returns a reference to the String object that's held in the pool. It's not clear whether the String object is copied, or if it's just a reference to the original String object. It's also not relevant.

  • 'Finally' is a rip off !! No use in java !!

    Hello guyz,
    Just wanted to discuss about the use of the keyword finally.
    "The finally is a Java keyword that is used to define a block that is always executed in a try&#8722;catch&#8722;finally statement. In java, there are three clauses named try, catch and finally used as exception handler components. A finally block
    typically contains cleanup code that recovers from partial execution of a try block."
    I mean if i don't even write my code in finally still it will execute outside the block if an exception occurs.
    how ever if an exception does't occur i have the same code executing twice....
    public class one
         public static void main(String args[])
              int i=27;
              try
                   System.out.println(i/2);
                   System.out.println("hey");
              catch(Exception e)
                   System.out.println(e);
              finally
                   System.out.println("hey");
    }please clarify... or i am going bananas here...

    like in this code
    public class one
         public static void main(String args[])
              int i=27;
              try
                   System.out.println(i/0);
                   System.out.println("hey");
              catch(Exception e)
                   System.out.println(e);
              System.out.println("hey");
    }

  • JAVA Feature

    As all we know, that java create its own platform which over its underlaying h/w , s/w . That's why java offers the nature of plateform indpendency. Due to which unlike any other language like c or c++ datatype and its storage size never depends upon underlaying syatem arch. My question is this since java creates such a protection for plateform independecy then what is the use of keyword "strictfp" which takes special care of floating point calculation ?

    strictfp is a Java keyword used to restrict floating-point calculations to ensure portability. The modifier was introduced into the Java programming language with the Java virtual machine version 1.2.
    In older JVMs, floating-point calculations were always strict floating-point, meaning all values used during floating-point calculations are made in the IEEE-standard float or double sizes. This could sometimes result in a numeric overflow or underflow in the middle of a calculation, even if the end result would be a valid number. Since version 1.2 of the JVM, floating-point calculations do not require that all numbers used in computations are themselves limited to the standard float or double precision.
    However, for some applications, a programmer might require every platform to have precisely the same floating-point behavior, even if some platforms could handle more precision. In that case, the programmer can use the modifier strictfp to ensure that calculations are performed as in the earlier versions?only with floats and doubles.
    The modifier can be used in combination with classes, interfaces and methods.
    this was taken from wikpedia hopefully that explains it to you. (i don't know if you are using a translator or not, but please proof read your posts, it took me awhile to figure what you meant.)
    (java creates it's own platform? Think about it, java provides portabilty how? (think peers))
    cheers
    octaclot
    Edited by: Octaclot on Oct 25, 2007 4:15 AM

  • End of year Java Project Question - File I/O

    Hello.
    My project involves allowing the user (which should be someone learning the very basics of Java and OOP) to copy and paste a one class program into a JTextArea. Then, they click a button which analyzes their code and visually shows how objects in their program interact with one another. My problem is that I am not sure of how to GET their code after it is pasted. I read up on FileReader/Writer but it seems like they save .txt files; I do not need to save the user's program on disk but only in memory and analyze their. Does anyone know of how I could do this? I obviously do not want to save it as a String because if the code is 100 lines long, then it just gets too messy. I would like to be able to read line by line what the user is trying to accomplish in their program in a txt file. If I could save a txt file and at close of the program, delete it, that could work too.
    Any help? Thanks in advance.

    Does anyone know of how I could do this? I obviously do not want to
    save it as a String because if the code is 100 lines long, then it just
    gets too messy. I would like to be able to read line by line what the
    user is trying to accomplish in their program in a txt file. If I could save
    a txt file and at close of the program, delete it, that could work too.huh? you can write a whole application on one line
    for (int i = 0 ; i < 10; i++){ System.out.println("Line 1"); System.out.println("line 2");  etc... }
    This is ambitious for an end of class project (a class project even)
    your application have to check the syntax, java keyword, keep what object is instantiate, what method is invoked..if that method belongs to the class...etc..

  • Syntax (keywords) highlighting ?

    Hi all,
    I am writing a JAVA code editor.
    How can I highlight JAVA keyword according to JAVA syntax library. Such as this, static, System.out.println
    Thank you

    You need to do a search first. This has been discussed a great deal on this forum - in the upper right, type "syntax highlighting" and search. You will get back numerous links to threads in which this very topic has been discussed. Read those threads and figure out what you want to do. Try to code some examples and post again when you have specific questions about your application.
    Good luck!

  • Is there any difference between java Beans and general class library?

    Hello,
    I know a Java Bean is just a java object. But also a general class instance is also a java object. So can you tell me difference between a java bean and a general class instance? Or are the two just the same?
    I assume a certain class is ("abc.class")
    Second question is is it correct that we must only use the tag <jsp:useBean id="obj" class="abc.class" scope="page" /> when we are writng jsp program which engage in using a class?Any other way to use a class( create object)? such as use the java keyword "new" inside jsp program?
    JohnWen604
    19-July-2005

    a bean is a Java class, but a Java class does not have to be a bean. In other words a bean in a specific Java class and has rules that have to be followed before you have a bean--like a no argument constructor. There are many other features of beans that you may implement if you so choose, but read over the bean tutorial and you'll see, there is a lot to a bean that is just not there for many of the Java classes.
    Second question: I'll defer to someone else, I do way to little JSP's to be able to say "must only[\b]".

  • Please uggest some java Interfaces

    I write all my java programmes in notepad.
    is there some interface or downloadable program where I can type java and it will have some color, etc?
    notepad is a pain especially when my programmes get longer and longer
    thanks

    If you like to type in a plain text editor but want to get highlights on Java keywords try Ultra Edit. I used it for a long time. You can even start programms from within, so you can start your compile and run by using key strokes while editing.
    If you like to enhance your programming not only by highlighted Java keywords but want to use a real development tool with debugger, object tree, package management, coding help with a tooltip of all possible methods you can use with a certain object after typing a point and many things more just use eclipse. It's open source, you can get it at www.eclipse.org.
    Rommie.

  • Help with creating a doubly linked list

    So I have been working with this file our teacher gave us, which is his own "list" ADT which I posted below (with out the comments so it doesn't stretch the page for ever)
    My question is, I cant really creat a DLL from this because I have nothing for the head, no previous or next or any of that...So could some one help me get off to the right start? Some of my class mates were like "create a SLL and then reverse it" well thats all fine and dandy but how?
    A couple other student said "With this DLL i only had to write two lines for each method to implement the list"...Can that be done? Theres NO documentation any where on a DLL for java, and the linkedList in the java api...I dont think that's a DLL...
    I SERIOUSLY need a nudge in the right direction....
    package assignment.four.utilities;
    import java.io.Serializable;
    public interface List<E> extends Serializable
         public int size ();
         public void clear ();
         public boolean add (int index, E toAdd) throws NullPointerException,
                                                                     IndexOutOfBoundsException;
         public boolean add (E toAdd) throws NullPointerException;
         public boolean addAll (List<? extends E> toAdd) throws NullPointerException;
         public E get (int index) throws IndexOutOfBoundsException;
         public E remove (int index) throws IndexOutOfBoundsException;
         public E remove (E toRemove) throws NullPointerException;
         public E set (int index, E toChange) throws NullPointerException,
                                                                IndexOutOfBoundsException;
         public boolean isEmpty ();
         public boolean contains (E toFind) throws NullPointerException;
         public E [] toArray (E [] toHold) throws NullPointerException;
         public E [] toArray ();
         public Iterator<E> iterator ();     
    }Again with my statement. Using that List ADT HOW do you even get started in the right direction to creating a DLL? I can use this to create an array list but i dont think i can for a dll?
    Edited by: user8974754 on Nov 20, 2010 8:00 PM

    user8974754 wrote:
    Ok thats fine and dandy but we never learned how to make a DLL we learned last semester how to make a SLL and I kinda get that but again with the So, you know how to make an SLL? Then I would suggest starting with that. For instance, you know how to define a Node or Element or whatever-you-want-to-call-it class that holds Data and Next? Start with that, and see if you can work out how to add a Previous.
    "there's nothing on DLL's" except for the same line over and over "They go backwards and forwards" and Im sorry but that doesn't cut it......So, [url http://www.youtube.com/watch?v=Ijae2WHdc9I]you know how to count blocks, but you don't know how to count oranges? That is, you know how to make forward links in a list, but not backward links? Really?
    Is there any examples of Java Dlls implementing lists and bla?I'm sure there are plenty, and I'm sure your google works as well as mine.
    like we cant implement any thing else as far as I know, it can only be this list....When I said you need to implement the various pieces, I meant in the normal English sense of the word, not in the Java keyword sense. Implementing a Node in the general sense is part of "implements List" in the Java keyword sense.
    I know the asking for a sample implementation might be considered cheating in some peoples books Yup.
    but i learn best from examples, explanations and what not...There's a world of difference between an example of a different use of the concepts that you're trying to learn and just doing your work for you. Whatever concepts this lesson is teaching that are being tested and reinforced by this homework, you can find plenty of examples without somebody providing a DLL implementation for you.
    Edited by: Am I still jverd? on Nov 20, 2010 9:05 PM

  • Coloured Text

    I am trying to develop an editor for 8085 assembly language programming. I need to display all key words like MVI MOV ADD ADDI etc in a colour different than the rest of the text. How do I do it? Any help would b greatly appreciated.

    http://www.discoverteenergy.com/files/SyntaxDocument.java
    The above class in an attempt to highlight java keywords, which it does pretty well. Most of the code in the class is related to highlighting multi-line comments, which it doesn't do very well. If all you need is keyword highlighting take a look at the keyword highlight code and throw out the rest.

  • In your experience

    I was going to post the link here but then I would be advertising and that is not my idea, so I decided to just post the content of the course.
    In your experience would you say that this is a good course for me to start with:? I do not have any back ground in programming but I am king to learn.
    In total this is a 5 day course based in London.
    Course Content
    Module 1 - Getting Started
    Origins of the language and its key features
    Describing the Java Runtime Environment and the components of the Java 2 Standard Edition (J2SE)
    Comparing local and distributed Java applications and associated security features
    Writing, compiling and running a simple Java application
    Using documentation for the J2SE class libraries
    Module 2 - Object-Oriented Programming
    Defining classes, objects, variables and methods
    Building an object and understanding object references and garbage collection
    Using constructor methods to initialise objects
    Using package and import statements to access the J2SE class libraries
    Applying access modifiers to object members
    Module 3 - Keywords and primitive types
    Recognizing Java Keywords
    Listing the eight primitive types
    Understanding conversion and casting of primitive types
    Recognizing and using Java operators
    Module 4 - Flow Control
    Iteration using for loops, while loops and do-while loops
    Building nested loops, and breaking out of a loop
    Using labels and the continue keyword
    Building alternative execution paths with a switch block
    Module 5 - Arrays
    Declaring, creating and initialising arrays of primitive types
    Building arrays of objects
    Building multi dimensional arrays
    Passing arguments into the main method of a command line application
    Building an application that uses arrays, method calls and iterative loops
    Module 6 - Object-Oriented design
    Describing the three pillars of object-oriented design (Inheritance, Polymorphism and Encapsulation)
    Inheritance and building a derived class
    Understanding a class hierarchy and the methods of the Object class
    Describing polymorphism and building an overriding method
    Enforcing polymorphism with interfaces and abstract classes
    Encapsulation and its advantages in producing maintainable code
    Module 7 - Further Class Features
    Building overloaded methods and constructors
    Declaring and using static variables and methods
    Declaring and using final classes, variables and methods
    Module 8 - Exceptions
    Defining exceptions and building code to handle a runtime exception
    Explaining the Exception class hierarchy and categories of exceptions
    Declaring methods that may throw exceptions
    Using the throw keyword forward an exception
    Building a user-defined Exception class
    Module 9 - Collections
    Categorising collections classes by the interfaces that they implement
    Using Sets, Lists and Maps to store collections of objects at runtime
    Building an iterator to access the objects in a Set
    Adding key - value pairs to a HashMap
    Using object reference casting when assigning references from a collection
    Module 10 - Building a Graphical User Interface (GUI)
    Describing the Swing package and its components
    Building an application window and adding components to the Content Pane
    Explaining layout managers and the rules by which they position components on a window
    Using BorderLayout, FlowLayout, GridLayout and GridBagLayout managers
    Building inner classes to handle events in a GUI , such as a menu selection
    Adding a user interface to the command line application built during previous modules
    Module 11 - Applets
    Comparing GUI applications to applets
    Explaining applet methods that are called by the browser
    Writing HTML code to display an applet within a web page
    Executing a Java 2 applet on any browser by automatically downloading the Java Runtime Environment
    Using the paint method to draw an image on a component
    Module 12 - Threads
    Creating threads to enable concurrent execution of multiple tasks
    Declaring synchronized code to prevent simultaneous access to a method by more than one thread
    Moving threads between states using the wait and notify methods
    Using a shared object to communicate between threads
    Module 13 - I/O Streams
    Interrogating the local file system
    Using Character Streams to read and write to a text file
    Understanding processing streams and linking them to sink streams
    Building byte streams to send and receive binary data
    Using object serialization to give persistence to objects
    Module 14 - Networking
    Distinguishing between Transmission Control Protocol (TCP) and User Datagram Protocol (UDP)
    Translating between character streams and byte streams
    Building a Server application that listens on a specified port
    Building a Client application that establishes a connection with the Server and sends some text
    Following by the second part :
    Course Content
    Module 1 - Java Database Connectivity (JDBC)
    Describing the JDBC architecture
    JDBC driver categories, including the JDBC-ODBC bridge and Type 4 drivers
    Establishing a database connection
    Creating and updating a database table
    Using batch updates and prepared statements
    Querying a database and extracting metadata
    Using record locking and committing or rolling back a transaction
    Handling SQL exceptions and obtaining the SQL state for single and chained exceptions
    Module 2- The Java API for XML Processing (JAXP)
    Explaining XML Document structure, namespaces and Document Type Definitions
    Parsing XML data with the Simple API for XML Parsing (SAX)
    Parsing XML data with the Document Object Model (DOM) and navigating through the DOM
    Writing code to read an XML file into a database table
    Reading a ResultSet from an SQL query into an XML DOM
    Transforming an XML document using an XSL stylesheet
    Module 3- Adding a Swing User Interface to the database application
    Defining Model-View-Controller architecture
    Using UML class diagrams to describe the types of objects in an application and their static relationships
    Building a GUI using ?drag and drop? and understanding the underlying code
    Using a TableModel object to parse and display XML data in a JTable
    Building a client-side Controller object to interact with the database
    Displaying input dialogs and message dialogs
    Module 4- Remote Method Invocation
    Describing the RMI architecture and the alternatives to RMI
    Listing the steps involved in developing applications using RMI
    Defining and implementing a remote interface
    Generating stubs, starting the registry and registering objects
    Looking up a remote object using the RMI protocol
    Dynamically loading and instantiating class files from a web server
    Implementing security with a policy file
    Creating worker threads for time-consuming tasks
    Module 5- Servlets and Web containers
    Explaining the purpose and structure of a Servlet, and deploying a Servlet in a Web Container
    Writing a Servlet that will return XML data from an SQL query sent over HTTP from a Web client.
    Adding code to enable the Servlet to be accessed from the Swing application client built during previous modules
    [ Note that, while Servlets are part of the Java 2 Enterprise Edition, this module may be useful to delegates who intend to deploy Java applications in a Web Container provided by their Internet Service Provider ]
    Many thanks for any comment reagarding my query.
    Kind Regards,

    There's no game development!

Maybe you are looking for

  • Printing blank report, not always

    Post Author: Simthembile CA Forum: Crystal Reports Good Day The Version of crpe32.dll on remote users machine is 8.0.0.371,Product version is 8.0.1.0, the crystal reports deployed are version 8.5.Any known issues that might arise because of this. We

  • Download stopped midway and is now lost, how do I get it back?

    I had a Digital Copy of the Hunger Games that I had redeemed and was downloading. It got down to 12 minutes from being finished (after probably around 4 hrs) and then iTunes froze and had to be shut down. This caused me to lose the download and I can

  • What FM is called on click of "To Form Selection" button in team viewer

    Hi experts,      I am working in team viewer in MSS portal and need to cutomize some code in any FM that gets called when you click on button "to form selection" after selecting employee. I rsearched everywhere in portal and all documentation in comp

  • Senior Members Please Help :(

    Recenly bought r9 290 card not detecting in Device manger - First of all here are my specifications : Motherboard :MSI Z68AGD80 (b3) Processor : I5 2500k 8GB Ram Gskill 5tb HDD +1 SSD 256 GB PSU : corsair TX 750 I even flashed the motherboard bios wi

  • Is there an advanced action that will open and close the TOC?

    I like that in CP5, Adobe has allowed users to change the icon associated with opening and closing a layered Table of Contents.  With that said, unfortunately, they show up so small, I can't see what I created.  So, I was wondering, is there an advan