HTML Character Entities

Some characters like the < character, have a special meaning in HTML, and therefore cannot be used in the text.

To display a less than sign (<) in HTML, we have to use a character entity.
Character Entities

Some characters have a special meaning in HTML, like the less than sign (<) that defines the start of an HTML tag. If we want the browser to actually display these characters we must insert character entities in the HTML source.

A character entity has three parts: an ampersand (&), an entity name or a # and an entity number, and finally a semicolon (;).

To display a less than sign in an HTML document we must write: < or <

The advantage of using a name instead of a number is that a name is easier to remember. The disadvantage is that not all browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers.

Note that the entities are case sensitive.




Non-breaking Space

The most common character entity in HTML is the non-breaking space.

Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them. To add spaces to your text, use the   character entity.
The Most Common Character Entities:Result Description Entity Name Entity Number
non-breaking space    
< less than < <
> greater than > >
& ampersand & &
" quotation mark " "
' apostrophe ' (does not work in IE) '

Some Other Commonly Used Character Entities:Result Description Entity Name Entity Number
¢ cent ¢ ¢
£ pound £ £
¥ yen ¥ ¥
€ euro € €
§ section § §
© copyright © ©
® registered trademark ® ®
× multiplication × ×
÷ division ÷ ÷

HTML Attributes

HTML Tag Attributes
HTML tags can have attributes. Attributes provide additional information to an HTML element.

Attributes always come in name/value pairs like this: name="value".

Attributes are always specified in the start tag of an HTML element.



Use Lowercase Attributes

Attributes and attribute values are case-insensitive. However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation, and XHTML demands lowercase attributes/attribute values.
Always Quote Attribute Values

Attribute values should always be enclosed in quotes. Double style quotes are the most common, but single style quotes are also allowed.

In some rare situations, like when the attribute value itself contains quotes, it is necessary to use single quotes:

name='John "ShotGun" Nelson'

Basic HTML Tags

The most important tags in HTML are tags that define headings, paragraphs and line breaks.

The best way to learn HTML is to work with examples. We have created a very nice HTML editor for you. With this editor, you can edit the HTML source code if you like, and click on a test button to view the result.


Headings

Headings are defined with the

to

tags.

defines the largest heading.

defines the smallest heading.

This is a heading


This is a heading


This is a heading


This is a heading


This is a heading

This is a heading



HTML automatically adds an extra blank line before and after a heading.
Paragraphs

Paragraphs are defined with the

tag.

This is a paragraph


This is another paragraph




HTML automatically adds an extra blank line before and after a paragraph.
Don't Forget the Closing Tag

You might have noticed that paragraphs can be written without end tags

:

This is a paragraph

This is another paragraph


The example above will work in most browsers, but don't rely on it. Future version of HTML will not allow you to skip ANY end tags.

Closing all HTML elements with an end tag is a future-proof way of writing HTML. It also makes the code easier to understand (read and browse) when you mark both where an element starts and where it ends.
Line Breaks

The
tag is used when you want to break a line, but don't want to start a new paragraph. The
tag forces a line break wherever you place it.

This
is a para
graph with line breaks




Try it yourself

The
tag is an empty tag. It has no end tag like
, since a closing tag doesn't make any sense.

or


More and more often you will see the
tag written like this:


Because the
tag has no end tag (or closing tag), it breaks one of the rules for future HTML (the XML based XHTML), namely that all elements must be closed.

Writing it like
is a future proof way of closing (or ending) the tag inside the opening tag, accepted by both HTML and XML.
Comments in HTML

The comment tag is used to insert a comment in the HTML source code. A comment will be ignored by the browser. You can use comments to explain your code, which can help you when you edit the source code at a later date.


Note that you need an exclamation point after the opening bracket, but not before the closing bracket.
Recap on HTML Elements
Each HTML element has an element name (body, h1, p, br)
The start tag is the name surrounded by angle brackets:


The end tag is a slash and the name surrounded by angle brackets


The element content occurs between the start tag and the end tag
Some HTML elements have no content
Some HTML elements have no end tag
Basic Notes - Useful Tips

When you write HTML text, you can never be sure how the text is displayed in another browser. Some people have large computer displays, some have small. The text will be reformatted every time the user resizes his window. Never try to format the text in your editor by adding empty lines and spaces to the text.

HTML will truncate the spaces in your text. Any number of spaces count as one. Some extra information: In HTML a new line counts as one space.

Using empty paragraphs

to insert blank lines is a bad habit. Use the
tag instead. (But don't use the
tag to create lists. Wait until you have learned about HTML lists.)

HTML automatically adds an extra blank line before and after some elements, like before and after a paragraph, and before and after a heading.

We use a horizontal rule (the


tag), to separate the sections in our tutorials


Basic HTML Tags

If you lookup the basic HTML tags in the reference below, you will see that the reference contains additional information about tag attributes.

You will learn more about HTML tag attributes in the next chapter of this tutorial.


Tag Description
Defines an HTML document
Defines the document's body

to

Defines header 1 to header 6

Defines a paragraph

Inserts a single line break


Defines a horizontal rule
Defines a comment


HTML Elements

HTML documents are text files made up of HTML elements.

HTML elements are defined using HTML tags.
HTML Tags
HTML tags are used to mark-up HTML elements
HTML tags are surrounded by the two characters < and >
The surrounding characters are called angle brackets
HTML tags normally come in pairs like and
The first tag in a pair is the start tag, the second tag is the end tag
The text between the start and end tags is the element content
HTML tags are not case sensitive, means the same as
HTML Elements

Remember the HTML example from the previous page:

Title of page


This is my first homepage. This text is bold




This is an HTML element:This text is bold


The HTML element starts with a start tag:
The content of the HTML element is: This text is bold
The HTML element ends with an end tag:


The purpose of the tag is to define an HTML element that should be displayed as bold.

This is also an HTML element:
This is my first homepage. This text is bold



This HTML element starts with the start tag , and ends with the end tag .

The purpose of the tag is to define the HTML element that contains the body of the HTML document.
Why do We Use Lowercase Tags?

We have just said that HTML tags are not case sensitive: means the same as . If you surf the Web, you will notice that plenty of web sites use uppercase HTML tags in their source code. We always use lowercase tags. Why?

If you want to follow the latest web standards, you should always use lowercase tags. The World Wide Web Consortium (W3C) recommends lowercase tags in their HTML 4 recommendation, and XHTML (the next generation HTML) demands lowercase tags.

Learn HTML

What is an HTML File?


HTML stands for Hyper Text Markup Language
An HTML file is a text file containing small markup tags
The markup tags tell the Web browser how to display the page
An HTML file must have an htm or html file extension
An HTML file can be created using a simple text editor
Do You Want to Try It?

If you are running Windows, start Notepad.

If you are on a Mac, start SimpleText.

In OSX start TextEdit and change the following preferences: Open the "Format" menu and select "Plain text" instead of "Rich text". Then open the "Preferences" window under the "Text Edit" menu and select "Ignore rich text commands in HTML files". Your HTML code will probably not work if you do not change the preferences above!

Type in the following text:

Title of page


This is my first homepage. This text is bold




Save the file as "mypage.htm".

Start your Internet browser. Select "Open" (or "Open Page") in the File menu of your browser. A dialog box will appear. Select "Browse" (or "Choose File") and locate the HTML file you just created - "mypage.htm" - select it and click "Open". Now you should see an address in the dialog box, for example "C:\MyDocuments\mypage.htm". Click OK, and the browser will display the page.
Example Explained

The first tag in your HTML document is . This tag tells your browser that this is the start of an HTML document. The last tag in your document is . This tag tells your browser that this is the end of the HTML document.

The text between the tag and the tag is header information. Header information is not displayed in the browser window.

The text between the tags is the title of your document. The title is displayed in your browser's caption. <br /> <br />The text between the <body> tags is the text that will be displayed in your browser. <br /> <br />The text between the <b> and </b> tags will be displayed in a bold font. <br />HTM or HTML Extension? <br /> <br />When you save an HTML file, you can use either the .htm or the .html extension. We have used .htm in our examples. It might be a bad habit inherited from the past when some of the commonly used software only allowed three letter extensions. <br /> <br />With newer software we think it will be perfectly safe to use .html. <br />Note on HTML Editors: <br /> <br />You can easily edit HTML files using a WYSIWYG (what you see is what you get) editor like FrontPage or Dreamweaver, instead of writing your markup tags in a plain text file. <br /> <br />However, if you want to be a skillful Web developer, we strongly recommend that you use a plain text editor to learn your primer HTML.</span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/learn-html.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/learn-html.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:49:00-07:00'>1:49 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=2381052939108450282' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=2381052939108450282&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/Learn%20HTML' rel='tag'>Learn HTML</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='1227351323823928930' itemprop='postId'/> <a name='1227351323823928930'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/java-criticism.html'>Java criticism</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1227351323823928930' itemprop='description articleBody'> <span style="font-weight:bold;">Java programming language was intended to serve as a novel way to manage software complexity. Many consider Java technology to deliver reasonably well on this promise. However, Java is not without flaws, and it does not universally accommodate all programming styles, environments, or requirements.<br /><br />Class path<br /><br />Running a Java program requires all third party supporting libraries to be in the class path. This can be an obstacle to portability, because its syntax is platform-specific: Windows-based systems use backslashes to mark subdirectories and semicolons to separate entries, whereas all other platforms use forward slashes to mark subdirectories and colons to separate entries.<br /><br /><br />It is also necessary for each .jar or .zip archive required to be explicitly named in the class path. Java provides a way around this by allowing directories listed in the class path to end in an asterisk (*), which will be expanded to the names of all files ending in .jar or .JAR within the directory. However, such an entry does not match .zip or .class files within that directory.<br /><br />License<br /><br />Sun Java's proprietary nature gave it a controversial position in the free software community. Because Sun's implementation of Java was not free software, it could not be included in projects that require a free software or GPL-compatible license, such as Debian main, the $100 laptop, and Fedora Core. Sun announced in JavaOne 2006 that Java will become open source software. The statement was issued by Sun Software Executive Vice President Rich Green: "It's not a question of whether, it's a question of how, and so we'll go do this." <br /><br /><br /><br />In July 2006, Sun's CTO Robert Brewin commented that Java will be partially open source by June 2007 but the entire platform will take more time to be fully open source. On November 13, 2006, Sun announced that its standard edition Java runtime environment will be released under the GPL by March of 2007. Its source code will be available under the GPL. According to Richard Stallman, this will mean an end to the Java trap. Mark Shuttleworth called the initial press announcement "a real milestone for the free software community."<br /><br />Resource management<br /><br /><br /><br />While Java does manage memory, it does not manage all resources, such as JDBC database connections; these must be released just as memory would need to be in C++.<br /><br />Memory management<br /><br />Java takes care of memory management. This was done as it makes it harder (but not impossible) for the programmer to create problems such as memory leaks. Java always allocates objects on the heap (unless optimized to the stack or registers by the JIT compiler) and local variables on the stack or in registers. This makes Java less flexible than C++, which allows programmers to choose where objects are allocated.<br /><br /><br />The garbage collector controls when objects are deleted from memory. Java does not allow programmers to guarantee when garbage collection happens (even with System.gc()), they cannot hold off garbage collection, and they cannot delete one particular object. While this makes programming much simpler and reduces memory leaks, it lacks the flexibility that can, in some cases, result in a more efficient handling of memory. Lower-level languages such as C or assembly language provide this flexibility.<br /><br />While many programs, such as those written in C++, tend to fall prey to memory leaks, this is not the whole story. Other resource leaks such as file handles, database and network connections are still likely, especially when exceptions are thrown. However, where C++ has the RAII idiom to address both cases, Java programmers need to remember to release resources in finally clauses and must have a good understanding of which resources Java will release and which they must release.<br /><br />Primitives vs. objects / Autoboxing<br /><br />Java designers decided not to implement certain features present in other languages (including multiple inheritance, operator overloading, and tuples).<br /><br />When generics were added to Java 5.0, there was already a large framework of classes (many of which were already deprecated), so generics were chosen to be implemented using erasure to allow backwards compatibility and preservation of these existing classes. This limited the features that could be provided by this addition as compared to other languages.<br /><br />Java's primitive types are not objects. Primitive types hold their values in the stack rather than being references to values. This was done for performance reasons. Because of this, Java is not considered to be a pure object-oriented programming language and this makes reflection more complicated. However, Java 5.0 supports automatic conversion (autoboxing) of primitive data types to corresponding object form wherever required, during compilation. When autounboxing, a null pointer exception may be thrown. Since this operation occurs implicitly (without a cast or method call), this unchecked exception may not be obvious by inspection of the line of code.<br /><br />Non-Virtual methods<br /><br />Java provides no way to make methods non-virtual (although they can be "sealed" by using the final modifier to disallow overriding). This means that there is no way to let derived classes define a new, unrelated method with the same name. This can be a problem when a base class is designed by a different person, and a new version introduces a method with the same name and signature as some method already present in the derived class. This means that the method in the derived class will implicitly override the method in the base class, even though that was not the intent of the designers of either class. To partially accommodate for these versioning problems, Java 5.0 introduced the @Override annotation, but to preserve backwards compatibility it could not be made compulsory by default.<br /><br />Single paradigm<br /><br />Java is predominantly a single-paradigm language. The addition of static imports in Java 5.0 accommodates the procedural paradigm better than earlier versions of Java.<br /><br />Exception handling<br /><br />Java embraced the concept of exception specifications from C++ where they were optional, but made throws clauses mandatory for any checked exception. While this can be a benefit for small systems, there is not universal agreement that using checked exceptions is a benefit for larger systems. In particular, "higher level" code is often not interested in errors thrown by "lower level" code (eg: NamingException). The coder of the naming classes must make a choice: either force higher level code to deal with naming exceptions as checked exceptions, or allow them to "bubble up" through his own low-level code without compile-time checks.<br /><br />Closure<br /><br />Finally, while anonymous inner classes provide a basic form of closures, they are not complete and require referenced variables to either be class fields or declared "final". The rationale behind this is that it allows JVM implementors to choose a stack model for variable lifetimes, so that a variable scope is removed when exited, thus preventing real closures. In addition, when using - for instance - "Runnable" as a closure, one has to declare the "run" method and put the code in that: you cannot simply put some code in braces and pass it around.<br /><br />Floating point arithmetic<br /><br />While Java's floating point arithmetic is largely based on IEEE 754 (Standard for Binary Floating-Point Arithmetic), certain features are not supported even when using the "strictfp" modifier, such as Exception Flags and Directed Roundings — capabilities mandated by IEEE Standard 754. Many so-called "Java gotchas" are not problems with Java per se, but problems that are inevitable whenever using floating point arithmetic.<br /><br />Look and feel<br /><br />The look and feel of GUI applications written in Java using the Swing platform is often different from native applications. While programmers can choose to use the AWT toolkit that displays native widgets (and thus look like the operating platform), the AWT toolkit is unable to meet advanced GUI programming needs by wrapping around advanced widgets and not sacrificing portability across the various supported platforms, each of which have vastly different APIs especially for higher-level widgets.<br /><br />The Swing toolkit--written completely in Java--both creates the problem of having a different look and feel from native applications, and avoids the problem of being limited by native toolkit capabilities because it reimplements widgets using only the most basic drawing mechanisms that are guaranteed available on all platforms. Unfortunately, the default installations of the JRE (as of August 2006) do not use the system's "native" look and feel, instead defaulting to the built-in Metal Look and Feel. If the programmer doesn't take care to set the native look and feel, users will have applications whose appearance is vastly different from that of their native applications. Apple Computer's own optimized version of the Java Runtime, which is included within the Mac OS X distribution, by default does set the default and implements its "Aqua" look-and-feel, giving Swing applications on the Macintosh a similar appearance to native software. Even in this environment, the programmer must still do some extra work to ensure that that application looks like an Aqua one (for example, they must set system properties to ensure the menubar is rendered in the OS X menubar and not in the application window as it would be on other platforms).<br /><br />Performance<br /><br />It is impossible to make any generalization about the performance of Java programs, because runtime performance is affected much more by the quality of the compiler or JVM than by any intrinsic properties of the language itself. Java bytecode can either be interpreted at run time by a virtual machine, or it can be compiled at load time or runtime into machine code which runs directly on the computer's hardware. Interpretation is slower than native execution, and compilation at load time or runtime has an initial performance penalty for the compilation.<br /><br />Lack of language features<br /><br />There are a few language requirements which incur an unavoidable time penalty, although these features are not unique to Java. Among these are array bounds checking, run-time type checking, and virtual function indirection (although each of these can in some situations be avoided by an optimizing compiler). Also the lack of features can affect performance. For example, Java does not have arrays of structures or a true multi-dimensional array, but only an array of references to objects or further arrays. Nor does Java allow returning more than one value from a function without using an object. The net result is that Java code makes more heap allocations than well-written code in some other languages.<br /><br />Garbage collection<br /><br />The use of a garbage collector to automatically delete objects adds overhead compared to manual deallocation and can have a positive or negative impact, or no discernible impact at all, on performance depending upon the garbage collector implementation and the characteristics of the application's use of objects. With the modern generational garbage collectors used in many JVMs, many applications actually experience greater performance because of faster allocation and deallocation algorithms.<br /><br />Byte code vs. native compilation<br /><br />Relative performance of JIT compilers as compared to native compilers can be quite close, and is often a subject of debate. The JIT compilation stage may be time consuming, which is inconvenient for applications that are short-lived and/or contain large amounts of code. Once compiled to native code, however, the performance of the program can be comparable to that achieved by a native compiler, even on numerical tasks. Although Java does not support manual inlining of method calls, many JIT compilers perform this optimization at load time and can exploit information from the runtime environment to guide more effective transformations, such as profile-directed inlining. Dynamic recompilation, as provided by Sun's HotSpot JVM, can exceed the performance of the static compilation available in most other languages by exploiting information that is only available at runtime.<br /><br />Hardware interfacing<br /><br />Because Java was designed with an emphasis on security and portability, it does not support direct access to the machine architecture and address space. This means working directly with a specific piece of hardware such as a scanner, digital camera, audio recorder, video capture, or virtually any hardware that requires direct memory space control (typically those pieces or hardware installed with drivers), cannot easily be accomplished with Java. An illustration of this issue is seen in version 1.0 of Java as it was not possible to access a printer because the interface code to the various printer drivers was not included in this first JVM.<br /><br />Interfacing with native code<br /><br />Clients side or server systems that need to "talk" to the hardware must implement a hybrid solution using Java and C/C++ or assembly language via the Java Native Interface (JNI) libraries to link native code to the Java libraries. An alternate solution is to code the hardware software component in its native C/C++/assembler language and then pass the data via files, databases or a shared memory interface, although this is not an ideal solution.<br /><br />Using the JNI technique introduces many possible inconsistencies such as: machine dependency, potential deadlock situations, memory allocation leaks, and possibly poor application performance, not to mention code complexity of needing to maintain two different code bases. However, it must be noted that it is a common case for other Virtual machine languages, as for example the .NET Framework Common Language Runtime (see Platform Invocation Services).<br /><br />Inconsistent JVM implementations<br /><br />Java is a bytecode language that runs on top of the JVM; ultimately the compatibility of the language and the ability to have it run across different platforms is dependent on the stability and version of the JVM. While Java is touted as running on a large variety of systems, the most up to date JVM (and JRE) are only those actively updated for Windows, Linux and Solaris. HP (such as Java for HP-UX) and IBM (for MVS, AIX, OS/400) provide their own implementations for their family of platforms but do not always mirror the latest Sun releases. Other JVM implementations usually follow, but sometimes lag in months or years with the more common implementations and therefore introduce compatibility issues.</span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/java-criticism.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/java-criticism.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:40:00-07:00'>1:40 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=1227351323823928930' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=1227351323823928930&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/Java%20criticism' rel='tag'>Java criticism</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='5003029341099793971' itemprop='postId'/> <a name='5003029341099793971'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/java-applet.html'>Java applet</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-5003029341099793971' itemprop='description articleBody'> <span style="font-weight:bold;">A Java applet is an applet delivered in the form of Java bytecode. Java applets can run in a Web browser using a Java Virtual Machine (JVM), or in Sun's AppletViewer, a stand alone tool to test applets. Java applets were introduced in the first version of the Java language in 1995. Java applets are usually written in the Java programming language but they can also be written in other languages that compile to Java bytecode such as Jython.<br /><br /><br /><br />Applets are used to provide interactive features to web applications that cannot be provided by HTML. Since Java's bytecode is platform independent, Java applets can be executed by browsers for many platforms, including Windows, Unix, Mac OS and Linux. There are open source tools like applet2app which can be used to convert an applet to a stand alone Java application/windows executable. This has the advantage of running a Java applet in offline mode without the need for internet browser software.<br /><br /><br /><br />A Java Servlet is sometimes informally compared to be "like" a server-side applet, but it is different in its language, functions, and in each of the characteristics described here about applets.<br /><br /><br /><br />Technical information<br /><br />Java applets are executed in a sandbox by most web browsers, preventing them from accessing local data. The code of the applet is downloaded from a web server and the browser either embeds the applet into a web page or opens a new window showing the applet's user interface. The applet can be displayed on the web page by making use of the deprecated applet HTML element or the recommended object element. This specifies the applet's source and the applet's location statistics.<br /><br />A Java applet extends the class java.applet.Applet, or in the case of a Swing applet, javax.swing.JApplet. The class must override methods from the applet class to set up a user interface inside itself (Applet is a descendant of Panel which is a descendant of Container).<br /><br /><br /><br />Advantages of applets<br /><br />A Java applet can have any or all of the following advantages:<br /><br />* it is simple to make it work on Windows, Mac OS and Linux, i.e. to make it cross platform<br />* the same applet can work on "all" installed versions of Java at the same time, rather than just the latest plug-in version only. However, if an applet requires a later version of the JRE the client will be forced wait during the large download.<br />* it runs in a sandbox, so the user does not need to trust the code, so it can work without security approval<br />* it is supported by most web browsers<br />* it will cache in most web browsers, so will be quick to load when returning to a web page<br />* it can have full access to the machine it is running on if the user agrees<br />* it can improve with use: after a first applet is run, the JVM is already running and starts quickly, benefiting regular users of Java<br />* it can run at a comparable (but generally slower) speed to other compiled languages such as C++<br />* it can be a real time application<br />* it can move the work from the server to the client, making a web solution more scalable with the number of users/clients<br /><br />Disadvantages of applets<br /><br />A Java applet is open to any of the following disadvantages:<br /><br />* it requires the Java plug-in, which isn't available by default on all web browsers<br />* it can't start up until the Java Virtual Machine is running, and this may have significant startup time the first time it is used<br />* if it is uncached, it must be downloaded (usually over the internet), and this takes time<br />* it is considered more difficult to build and design a good user interface with applets than with HTML-based technologies<br />* if untrusted, it has severely limited access to the user's system - in particular having no direct access to the client's disc or clipboard<br />* some organizations only allow software installed by the administrators. As a result, many users cannot view applets by default.<br />* applets may require a specific JRE.<br /><br />Compatibility issues<br /><br />Sun has made a considerable effort to ensure compatibility is maintained between Java versions as they evolve. For example, Microsoft's Internet Explorer, the most popular web browser since the late 1990s, used to ship with Microsoft's own JVM as the default. The MSJVM had some extra non-Java features added which, if used, would prevent MSJVM applets from running on Sun's Java (but not the other way round). Sun sued for breach of trademark, as the point of Java was that there should be no proprietary extensions and that code should work everywhere. Development of MSJVM was frozen by a legal settlement, leaving many users with an extremely outdated Java virtual machine. Later, in October 2001, MS stopped including Java with Windows, and for some years it has been left to the computer manufacturers to ship Java independently of the OS. Most new machines now ship with official Sun Java.<br /><br />Some browsers (notably Firefox) do not do a good job of handling height=100% on applets which makes it difficult to make an applet fill most of the browser window (Javascript can, with difficulty, be used for this). Having the applet create its own main window is not a good solution either, as this leads to a large chance of the applet getting terminated unintentionally and leaves the browser window as a largely useless extra window.<br /><br />Alternatives<br /><br />Alternative technologies exist (for example, DHTML and Flash) that satisfy some of the scope of what is possible with an applet.<br /><br />Another alternative to applets for client side Java is Java Web Start, which runs outside the browser. In addition to the features available to applets, a simple permissions box can give Java Web Start programs read and/or write access to specified files stored on the client, and to the client's clipboard.</span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/java-applet.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/java-applet.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:40:00-07:00'>1:40 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=5003029341099793971' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=5003029341099793971&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/Java%20applet' rel='tag'>Java applet</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='2185611866966497493' itemprop='postId'/> <a name='2185611866966497493'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/java-string-utility.html'>JAVA String Utility</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-2185611866966497493' itemprop='description articleBody'> <span style="font-weight:bold;">( This program Demonstrates the proper use of Number Formats in common java programming scenarios )<br /><br />String Utility <br />/*<br /> * NumberUtility.java<br /> *<br /> * Source: http://www.freejavaguide.com <br /> */<br /><br />import java.math.BigDecimal;<br />import java.text.DecimalFormat;<br />import java.text.DecimalFormatSymbols;<br />import java.util.Locale;<br /><br />/**<br /> * Class provides common functions on number formats.<br /> */<br /><br />public class NumberUtility {<br /> <br /> /**<br /> * Method takes Object as parameter and returns decimal number.<br /> * if argument is float or double and contains tailing zeros<br /> * it removes them. If argument is float or double then no change in return type.<br /> * Change the Format of the Number by changing the String Pattern<br /> */<br /> public static String changeToDecimalFormat(Object number) {<br /><br /> BigDecimal bdNumber = new BigDecimal(number.toString());<br /> bdNumber = bdNumber.stripTrailingZeros(); //Returns a BigDecimal with any trailing zero's removed<br /> String pattern = "###,##0.0###########"; //To apply formatting when the number of digits in input equals the pattern<br /> DecimalFormat newFormat = new DecimalFormat(pattern, new DecimalFormatSymbols(Locale.US));<br /> return newFormat.format(bdNumber);<br /><br /> }<br /><br /> /* Method takes Object as parameter and removes commas from the parameter */<br /> public static double removeCommasFromNumber(Object number) {<br /> try {<br /> StringBuffer inputNo = new StringBuffer(number.toString());<br /> if (inputNo.length() > 0) {<br /> while (inputNo.indexOf(",") != -1) {<br /> inputNo.deleteCharAt(inputNo.indexOf(","));<br /> }<br /> } else {<br /> return 0.0;<br /> }<br /> return Double.parseDouble(inputNo.toString());<br /><br /> } catch (NumberFormatException e) {<br /> return 0.0;<br /> }<br /> }<br /><br /> /* Some times its required to have a fixed set of decimal places for a <br /> * number. We can set that by changing the precision number for a particular<br /> * input BigDecimal Input String<br /> */<br /> public static String changeToRequiredDecimals(String bigDecimalString,<br /> int precision) {<br /> String newFormattedString = null;<br /> String afterDecimal = null;<br /> if (bigDecimalString == null || bigDecimalString.length() == 0) {<br /> return "0.0";<br /> }<br /> if (bigDecimalString.contains(".")) {<br /> afterDecimal = bigDecimalString.substring(bigDecimalString<br /> .indexOf(".") + 1);<br /> int length = Math.abs((afterDecimal.length() - precision));<br /> if (afterDecimal.length() < precision) {<br /> newFormattedString = bigDecimalString;<br /> for (int i = 0; i < length; i++) {<br /> newFormattedString = newFormattedString + "0";<br /> }<br /> } else if (afterDecimal.length() > precision) {<br /> newFormattedString = bigDecimalString.substring(0,<br /> bigDecimalString.length() - length);<br /> if (precision == 0) {<br /> newFormattedString = newFormattedString.substring(0,<br /> newFormattedString.indexOf("."));<br /> } else {<br /> newFormattedString = bigDecimalString;<br /> }<br /><br /> } else {<br /> if (precision > 0)<br /> newFormattedString = bigDecimalString + ".";<br /> else<br /> newFormattedString = bigDecimalString;<br /> for (int i = 0; i < precision; i++) {<br /> newFormattedString = newFormattedString + "0";<br /> }<br /> }<br /> }<br /> return newFormattedString;<br /> }<br /><br /> public static void main(String args[]){<br /> int intVar = 10;<br /> double doubleVar = 10.504000;<br /> float floatVar = 343534534348.5687654F;<br /> String commaString = "343,534,535,000.0";<br /> BigDecimal bdNumber = new BigDecimal("1234.8765");<br /> <br /> <br /> System.out.println(NumberUtility.changeToDecimalFormat(new Integer(intVar)));<br /> System.out.println(NumberUtility.changeToDecimalFormat(new Double(doubleVar)));<br /> System.out.println(NumberUtility.changeToDecimalFormat(new Float(floatVar)));<br /> <br /> System.out.println(NumberUtility.removeCommasFromNumber(commaString));<br /> <br /> System.out.println(NumberUtility.changeToRequiredDecimals(bdNumber.toString(), 8));<br /> <br /> }<br />}<br /><br /> </span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/java-string-utility.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/java-string-utility.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:38:00-07:00'>1:38 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=2185611866966497493' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=2185611866966497493&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/JAVA%20String%20Utility' rel='tag'>JAVA String Utility</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='1499739641908789749' itemprop='postId'/> <a name='1499739641908789749'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/java-date-utility.html'>JAVA Date Utility</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1499739641908789749' itemprop='description articleBody'> <span style="font-weight:bold;">( This program Demonstrates the proper use of Date functionality in common java programming scenarios )<br /><br />Date and Time <br /><br /> <br />import java.text.DateFormat;<br />import java.text.ParseException;<br />import java.text.SimpleDateFormat;<br />import java.util.Calendar;<br />import java.util.Date;<br />public class DateUtility {<br /> <br />/* Add Day/Month/Year to a Date<br />add() is used to add values to a Calendar object. <br />You specify which Calendar field is to be affected by the operation <br />(Calendar.YEAR, Calendar.MONTH, Calendar.DATE). <br />*/<br /> public static void addToDate(){<br /> System.out.println("In the ADD Operation");<br /> // String DATE_FORMAT = "yyyy-MM-dd";<br /> String DATE_FORMAT = "dd-MM-yyyy"; //Refer Java DOCS for formats<br /> java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT);<br /> Calendar c1 = Calendar.getInstance();<br /> Date d1 = new Date();<br /> System.out.println("Todays date in Calendar Format : "+c1);<br /> System.out.println("c1.getTime() : "+c1.getTime());<br /> System.out.println("c1.get(Calendar.YEAR): " + c1.get(Calendar.YEAR));<br /> System.out.println("Todays date in Date Format : "+d1);<br /> c1.set(1999,0 ,20); //(year,month,date)<br /> System.out.println("c1.set(1999,0 ,20) : "+c1.getTime());<br /> c1.add(Calendar.DATE,40);<br /> System.out.println("Date + 20 days is : " + sdf.format(c1.getTime()));<br /> System.out.println();<br /> System.out.println();<br /> }<br /> <br /> <br />/*Substract Day/Month/Year to a Date<br /> roll() is used to substract values to a Calendar object. <br /> You specify which Calendar field is to be affected by the operation <br /> (Calendar.YEAR, Calendar.MONTH, Calendar.DATE). <br /> <br /> Note: To substract, simply use a negative argument. <br /> roll() does the same thing except you specify if you want to roll up (add 1) <br /> or roll down (substract 1) to the specified Calendar field. The operation only<br /> affects the specified field while add() adjusts other Calendar fields. <br /> See the following example, roll() makes january rolls to december in the same <br /> year while add() substract the YEAR field for the correct result<br /><br />*/<br /> <br /> public static void subToDate(){<br /> System.out.println("In the SUB Operation");<br /> String DATE_FORMAT = "dd-MM-yyyy";<br /> java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT);<br /> Calendar c1 = Calendar.getInstance(); <br /> c1.set(1999, 0 , 20); <br /> System.out.println("Date is : " + sdf.format(c1.getTime()));<br /> <br /> // roll down, substract 1 month<br /> c1.roll(Calendar.MONTH, false); <br /> System.out.println("Date roll down 1 month : " + sdf.format(c1.getTime())); <br /><br /> c1.set(1999, 0 , 20); <br /> System.out.println("Date is : " + sdf.format(c1.getTime()));<br /> c1.add(Calendar.MONTH, -1); <br /> // substract 1 month<br /> System.out.println("Date minus 1 month : " + sdf.format(c1.getTime())); <br /> System.out.println();<br /> System.out.println();<br /> }<br /> <br /> public static void daysBetween2Dates(){<br /> Calendar c1 = Calendar.getInstance(); //new GregorianCalendar();<br /> Calendar c2 = Calendar.getInstance(); //new GregorianCalendar();<br /> c1.set(1999, 0 , 20); <br /> c2.set(1999, 0 , 22); <br /> System.out.println("Days Between "+c1.getTime()+"\t"+ c2.getTime()+" is");<br /> System.out.println((c2.getTime().getTime() - c1.getTime().getTime())/(24*3600*1000));<br /> System.out.println();<br /> System.out.println();<br /> }<br /> <br /> public static void daysInMonth() {<br /> Calendar c1 = Calendar.getInstance(); //new GregorianCalendar();<br /> c1.set(1999, 6 , 20); <br /> int year = c1.get(Calendar.YEAR);<br /> int month = c1.get(Calendar.MONTH);<br />// int days = c1.get(Calendar.DATE);<br /> int [] daysInMonths = {31,28,31,30,31,30,31,31,30,31,30,31};<br /> daysInMonths[1] += DateUtility.isLeapYear(year) ? 1 : 0;<br /> System.out.println("Days in "+month+"th month for year "+year+" is "+ daysInMonths[c1.get(Calendar.MONTH)]);<br /> System.out.println();<br /> System.out.println();<br /> }<br /> <br /> public static void getDayofTheDate() {<br /> Date d1 = new Date();<br /> String day = null;<br /> DateFormat f = new SimpleDateFormat("EEEE");<br /> try {<br /> day = f.format(d1);<br /> }<br /> catch(Exception e) {<br /> e.printStackTrace();<br /> }<br /> System.out.println("The dat for "+d1+" is "+day);<br /> System.out.println();<br /> System.out.println();<br /> }<br /> <br /> public static void validateAGivenDate() {<br /> String dt = "20011223"; <br /> String invalidDt = "20031315";<br /> String dateformat = "yyyyMMdd"; <br /> Date dt1=null , dt2=null;<br /> try { <br /> SimpleDateFormat sdf = new SimpleDateFormat(dateformat); <br /> sdf.setLenient(false); <br /> dt1 = sdf.parse(dt); <br /> dt2 = sdf.parse(invalidDt); <br /> System.out.println("Date is ok = " + dt1 + "(" + dt + ")"); <br /> } <br /> catch (ParseException e) { <br /> System.out.println(e.getMessage()); <br /> } <br /> catch (IllegalArgumentException e) { <br /> System.out.println("Invalid date"); <br /> }<br /> System.out.println();<br /> System.out.println();<br /> }<br /> <br /> public static void compare2Dates(){<br /> SimpleDateFormat fm = new SimpleDateFormat("dd-MM-yyyy");<br /> Calendar c1 = Calendar.getInstance();<br /> Calendar c2 = Calendar.getInstance();<br /> <br /> c1.set(2000, 02, 15);<br /> c2.set(2001, 02, 15);<br /> <br /> System.out.print(fm.format(c1.getTime())+" is ");<br /> if(c1.before(c2)){<br /> System.out.println("less than "+c2.getTime());<br /> }else if(c1.after(c2)){<br /> System.out.println("greater than "+c2.getTime());<br /> }else if(c1.equals(c2)){<br /> System.out.println("is equal to "+fm.format(c2.getTime()));<br /> }<br /> System.out.println();<br /> System.out.println();<br /> }<br /><br /> public static boolean isLeapYear(int year){<br /> if((year%100 != 0) || (year%400 == 0)){<br /> return true;<br /> }<br /> return false;<br /> }<br /><br /> public static void main(String args[]){<br /> addToDate();<br /> subToDate();<br /> daysBetween2Dates(); //The "right" way would be to compute the julian day number of both dates and then do the substraction.<br /> daysInMonth();<br /> validateAGivenDate();<br /> compare2Dates();<br /> getDayofTheDate();<br /> }<br /> <br />}<br /><br /> </span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/java-date-utility.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/java-date-utility.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:37:00-07:00'>1:37 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=1499739641908789749' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=1499739641908789749&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/JAVA%20Date%20Utility' rel='tag'>JAVA Date Utility</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='7274730573122604629' itemprop='postId'/> <a name='7274730573122604629'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/core-java-programs-page-2.html'>Core Java Programs [ PAGE 2]</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-7274730573122604629' itemprop='description articleBody'> <span style="font-weight:bold;">Program 11<br /><br />/* Write a program to Concatenate string using for Loop<br /><br /> Example:<br /><br /> Input - 5<br /><br /> Output - 1 2 3 4 5 */<br /><br />class Join{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> String result = " ";<br /><br /> for(int i=1;i<=num;i++){<br /><br /> result = result + i + " ";<br /><br /> }<br /><br /> System.out.println(result);<br /><br /> }<br /><br />}<br /><br />Program 12 <br /><br />/* Program to Display Multiplication Table */<br /><br />class MultiplicationTable{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> System.out.println("*****MULTIPLICATION TABLE*****");<br /><br /> for(int i=1;i<=num;i++){<br /><br /> for(int j=1;j<=num;j++){<br /><br /> System.out.print(" "+i*j+" ");<br /><br /> }<br /><br /> System.out.print("\n");<br /><br /> }<br /><br /> }<br /><br />}<br /><br />Program 13<br /><br />/* Write a program to Swap the values */<br /><br />class Swap{<br /><br /> public static void main(String args[]){<br /><br /> int num1 = Integer.parseInt(args[0]);<br /><br /> int num2 = Integer.parseInt(args[1]);<br /><br /> System.out.println("\n***Before Swapping***");<br /><br /> System.out.println("Number 1 : "+num1);<br /><br /> System.out.println("Number 2 : "+num2);<br /><br /> //Swap logic<br /><br /> num1 = num1 + num2;<br /><br /> num2 = num1 - num2;<br /><br /> num1 = num1 - num2;<br /><br /> System.out.println("\n***After Swapping***");<br /><br /> System.out.println("Number 1 : "+num1);<br /><br /> System.out.println("Number 2 : "+num2);<br /><br /> }<br /><br />}<br /><br />Program 14<br /><br />/* Write a program to convert given no. of days into months and days.<br /><br /> (Assume that each month is of 30 days)<br /><br /> Example :<br /><br /> Input - 69<br /><br /> Output - 69 days = 2 Month and 9 days */<br /><br />class DayMonthDemo{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> int days = num%30;<br /><br /> int month = num/30;<br /><br /> System.out.println(num+" days = "+month+" Month and "+days+" days");<br /><br /> }<br /><br />}<br /><br />Program 15<br /><br />/*Write a program to generate a Triangle.<br /><br /> eg:<br /><br /> 1<br /><br /> 2 2<br /><br /> 3 3 3<br /><br /> 4 4 4 4 and so on as per user given number */<br /><br />class Triangle{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> for(int i=1;i<=num;i++){<br /><br /> for(int j=1;j<=i;j++){<br /><br /> System.out.print(" "+i+" ");<br /><br /> }<br /><br /> System.out.print("\n");<br /><br /> } <br /><br /> }<br /><br />}<br /><br />Program 16<br /><br />/* Write a program to Display Invert Triangle.<br /><br /> Example:<br /><br /> Input - 5<br /><br /> Output :<br /><br /> 5 5 5 5 5<br /><br /> 4 4 4 4<br /><br /> 3 3 3<br /><br /> 2 2<br /><br /> 1<br /><br />*/<br /><br />class InvertTriangle{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> while(num > 0){<br /><br /> for(int j=1;j<=num;j++){<br /><br /> System.out.print(" "+num+" ");<br /><br /> }<br /><br /> System.out.print("\n");<br /><br /> num--;<br /><br /> }<br /><br /> }<br /><br />}<br /><br />Program 17<br /><br />/*Write a program to find whether given no. is Armstrong or not.<br /><br /> Example :<br /><br /> Input - 153<br /><br /> Output - 1^3 + 5^3 + 3^3 = 153, so it is Armstrong no. */<br /><br />class Armstrong{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> int n = num; //use to check at last time<br /><br /> int check=0,remainder;<br /><br /> while(num > 0){<br /><br /> remainder = num % 10;<br /><br /> check = check + (int)Math.pow(remainder,3);<br /><br /> num = num / 10;<br /><br /> }<br /><br /> if(check == n)<br /><br /> System.out.println(n+" is an Armstrong Number");<br /><br /> else<br /><br /> System.out.println(n+" is not a Armstrong Number");<br /><br /> }<br /><br />}<br /><br />Program 18<br /><br />/* Write a program to Find whether number is Prime or Not. */<br /><br />class PrimeNo{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> int flag=0;<br /><br /> for(int i=2;i<num;i++){<br /><br /> if(num%i==0)<br /><br /> {<br /><br /> System.out.println(num+" is not a Prime Number");<br /><br /> flag = 1;<br /><br /> break;<br /><br /> }<br /><br /> }<br /><br /> if(flag==0)<br /><br /> System.out.println(num+" is a Prime Number");<br /><br /> }<br /><br />}<br /><br />Program 19<br /><br />/* Write a program to find whether no. is palindrome or not.<br /><br /> Example :<br /><br /> Input - 12521 is a palindrome no.<br /><br /> Input - 12345 is not a palindrome no. */<br /><br />class Palindrome{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> int n = num; //used at last time check<br /><br /> int reverse=0,remainder;<br /><br /> while(num > 0){<br /><br /> remainder = num % 10;<br /><br /> reverse = reverse * 10 + remainder;<br /><br /> num = num / 10;<br /><br /> }<br /><br /> if(reverse == n)<br /><br /> System.out.println(n+" is a Palindrome Number");<br /><br /> else<br /><br /> System.out.println(n+" is not a Palindrome Number");<br /><br /> }<br /><br />}</span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/core-java-programs-page-2.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/core-java-programs-page-2.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:35:00-07:00'>1:35 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=7274730573122604629' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=7274730573122604629&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5B%20PAGE%202%5D' rel='tag'>Core Java Programs [ PAGE 2]</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='7302619823339471275' itemprop='postId'/> <a name='7302619823339471275'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/core-java-programs-page-3.html'>Core Java Programs [PAGE 3]</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-7302619823339471275' itemprop='description articleBody'> <span style="font-weight:bold;"><br /><br />Some Java programs which help lot of java beginners to understand the basic fundamentals in Java programming. Most of these programs take input from the command line. Ex - int num = Integer.parseInt(args[0]);<br /><br />Program 20<br /><br />/* switch case demo<br /><br /> Example :<br /><br /> Input - 124<br /><br /> Output - One Two Four */<br /><br /> <br /><br />class SwitchCaseDemo{<br /><br /> public static void main(String args[]){<br /><br /> try{<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> int n = num; //used at last time check<br /><br /> int reverse=0,remainder;<br /><br /> while(num > 0){<br /><br /> remainder = num % 10;<br /><br /> reverse = reverse * 10 + remainder;<br /><br /> num = num / 10;<br /><br /> }<br /><br /> String result=""; //contains the actual output<br /><br /> while(reverse > 0){<br /><br /> remainder = reverse % 10;<br /><br /> reverse = reverse / 10;<br /><br /> switch(remainder){<br /><br /> case 0 :<br /><br /> result = result + "Zero ";<br /><br /> break;<br /><br /> case 1 :<br /><br /> result = result + "One ";<br /><br /> break;<br /><br /> case 2 :<br /><br /> result = result + "Two ";<br /><br /> break;<br /><br /> case 3 :<br /><br /> result = result + "Three ";<br /><br /> break;<br /><br /> case 4 :<br /><br /> result = result + "Four ";<br /><br /> break;<br /><br /> case 5 :<br /><br /> result = result + "Five ";<br /><br /> break;<br /><br /> case 6 :<br /><br /> result = result + "Six ";<br /><br /> break;<br /><br /> case 7 :<br /><br /> result = result + "Seven ";<br /><br /> break;<br /><br /> case 8 :<br /><br /> result = result + "Eight ";<br /><br /> break;<br /><br /> case 9 :<br /><br /> result = result + "Nine ";<br /><br /> break;<br /><br /> default:<br /><br /> result="";<br /><br /> }<br /><br /> }<br /><br /> System.out.println(result);<br /><br /> }catch(Exception e){<br /><br /> System.out.println("Invalid Number Format");<br /><br /> }<br /><br /> }<br /><br />}<br /><br />Program 21<br /><br />/* Write a program to generate Harmonic Series.<br /><br /> Example :<br /><br /> Input - 5<br /><br /> Output - 1 + 1/2 + 1/3 + 1/4 + 1/5 = 2.28 (Approximately) */<br /><br />class HarmonicSeries{<br /><br /> public static void main(String args[]){<br /><br /> int num = Integer.parseInt(args[0]);<br /><br /> double result = 0.0;<br /><br /> while(num > 0){<br /><br /> result = result + (double) 1 / num;<br /><br /> num--;<br /><br /> }<br /><br /> System.out.println("Output of Harmonic Series is "+result);<br /><br /> }<br /><br />}<br /><br />Program 22<br /><br />/*Write a program to find average of consecutive N Odd no. and Even no. */<br /><br />class EvenOdd_Avg{<br /><br /> public static void main(String args[]){<br /><br /> int n = Integer.parseInt(args[0]);<br /><br /> int cntEven=0,cntOdd=0,sumEven=0,sumOdd=0;<br /><br /> while(n > 0){<br /><br /> if(n%2==0){<br /><br /> cntEven++;<br /><br /> sumEven = sumEven + n;<br /><br /> }<br /><br /> else{<br /><br /> cntOdd++;<br /><br /> sumOdd = sumOdd + n;<br /><br /> }<br /><br /> n--;<br /><br /> }<br /><br /> int evenAvg,oddAvg;<br /><br /> evenAvg = sumEven/cntEven;<br /><br /> oddAvg = sumOdd/cntOdd;<br /><br /> System.out.println("Average of first N Even no is "+evenAvg);<br /><br /> System.out.println("Average of first N Odd no is "+oddAvg);<br /><br /> <br /><br /> }<br /><br />}<br /><br />Program 23<br /><br />/* Display Triangle as follow : BREAK DEMO.<br /><br /> 1<br /><br /> 2 3<br /><br /> 4 5 6<br /><br /> 7 8 9 10 ... N */<br /><br />class Output1{<br /><br /> public static void main(String args[]){<br /><br /> int c=0;<br /><br /> int n = Integer.parseInt(args[0]);<br /><br /> loop1: for(int i=1;i<=n;i++){<br /><br /> loop2: for(int j=1;j<=i;j++){<br /><br /> if(c!=n){<br /><br /> c++;<br /><br /> System.out.print(c+" ");<br /><br /> }<br /><br /> else<br /><br /> break loop1;<br /><br /> }<br /><br /> System.out.print("\n");<br /><br /> }<br /><br /> }<br /><br />}<br /><br />Program 24<br /><br />/* Display Triangle as follow<br /><br /> 0<br /><br /> 1 0<br /><br /> 1 0 1<br /><br /> 0 1 0 1 */<br /><br />class Output2{<br /><br /> public static void main(String args[]){<br /><br /> for(int i=1;i<=4;i++){<br /><br /> for(int j=1;j<=i;j++){<br /><br /> System.out.print(((i+j)%2)+" ");<br /><br /> }<br /><br /> System.out.print("\n");<br /><br /> }<br /><br /> }<br /><br />} <br /><br />Program 25<br /><br />/* Display Triangle as follow<br /><br /> 1<br /><br /> 2 4<br /><br /> 3 6 9<br /><br /> 4 8 12 16 ... N (indicates no. of Rows) */<br /><br />class Output3{<br /><br /> public static void main(String args[]){<br /><br /> int n = Integer.parseInt(args[0]);<br /><br /> for(int i=1;i<=n;i++){<br /><br /> for(int j=1;j<=i;j++){<br /><br /> System.out.print((i*j)+" ");<br /><br /> }<br /><br /> System.out.print("\n");<br /><br /> }<br /><br /> }<br /><br />}</span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/core-java-programs-page-3.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/core-java-programs-page-3.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:34:00-07:00'>1:34 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=7302619823339471275' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=7302619823339471275&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5BPAGE%203%5D' rel='tag'>Core Java Programs [PAGE 3]</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='1349118309869716074' itemprop='postId'/> <a name='1349118309869716074'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/core-java-programs-page-1.html'>Core Java Programs [ PAGE 1]</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1349118309869716074' itemprop='description articleBody'> <span style="font-weight: bold;"></span> <br /><span style="font-weight: bold;">Some Java programs which help lot of java beginners to understand the basic fundamentals in Java programming.</span> <br /><span style="font-weight: bold;"> </span> <br /> <br /> <br /> <br /> <br /><span style="font-weight: bold;">Program 1</span> <br /> <br /><span style="font-weight: bold;">//Find Maximum of 2 nos.</span> <br /> <br /><span style="font-weight: bold;">class Maxof2{</span> <br /> <br /><span style="font-weight: bold;"> public static void main(String args[]){</span> <br /> <br /><span style="font-weight: bold;"> //taking value as command line argument.</span> <br /> <br /><span style="font-weight: bold;"> //Converting String format to Integer value</span> <br /> <br /><span style="font-weight: bold;"> int i = Integer.parseInt(args[0]);</span> <br /> <br /><span style="font-weight: bold;"> int j = Integer.parseInt(args[1]);</span> <br /> <br /><span style="font-weight: bold;"> if(i > j)</span> <br /> <br /><span style="font-weight: bold;"> System.out.println(i+" is greater than "+j);</span> <br /> <br /><span style="font-weight: bold;"> else</span> <br /> <br /><span style="font-weight: bold;"> System.out.println(j+" is greater than "+i);</span> <br /> <br /><span style="font-weight: bold;"> }</span> <br /> <br /><span style="font-weight: bold;">}</span> <br /> <br /><span style="font-weight: bold;">Program 2</span> <br /> <br /><span style="font-weight: bold;">//Find Minimum of 2 nos. using conditional operator</span> <br /> <br /><span style="font-weight: bold;">class Minof2{</span> <br /> <br /><span style="font-weight: bold;"> public static void main(String args[]){</span> <br /> <br /><span style="font-weight: bold;"> //taking value as command line argument.</span> <br /> <br /><span style="font-weight: bold;"> //Converting String format to Integer value</span> <br /> <br /><span style="font-weight: bold;"> int i = Integer.parseInt(args[0]);</span> <br /> <br /><span style="font-weight: bold;"> int j = Integer.parseInt(args[1]);</span> <br /> <br /><span style="font-weight: bold;"> int result = (i<j)?i:j;</span> <br /> <br /><span style="font-weight: bold;"> System.out.println(result+" is a minimum value");</span> <br /> <br /><span style="font-weight: bold;"> }</span> <br /> <br /><span style="font-weight: bold;">}</span> <br /> <br /><span style="font-weight: bold;">Program 3</span> <br /> <br /><span style="font-weight: bold;">/* Write a program that will read a float type value from the keyboard and print the following output.</span> <br /> <br /><span style="font-weight: bold;"> ->Small Integer not less than the number.</span> <br /> <br /><span style="font-weight: bold;"> ->Given Number.</span> <br /> <br /><span style="font-weight: bold;"> ->Largest Integer not greater than the number.</span> <br /> <br /><span style="font-weight: bold;">*/</span> <br /> <br /><span style="font-weight: bold;">class ValueFormat{</span> <br /> <br /><span style="font-weight: bold;"> public static void main(String args[]){</span> <br /> <br /><span style="font-weight: bold;"> double i = 34.32; //given number </span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Small Integer not greater than the number : "+Math.ceil(i));</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Given Number : "+i);</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Largest Integer not greater than the number : "+Math.floor(i));</span> <br /> <br /><span style="font-weight: bold;"> }</span> <br /> <br /><span style="font-weight: bold;">Program 4</span> <br /> <br /><span style="font-weight: bold;">/*Write a program to generate 5 Random nos. between 1 to 100, and it</span> <br /> <br /><span style="font-weight: bold;"> should not follow with decimal point.</span> <br /> <br /><span style="font-weight: bold;">*/</span> <br /> <br /><span style="font-weight: bold;">class RandomDemo{</span> <br /> <br /><span style="font-weight: bold;"> public static void main(String args[]){</span> <br /> <br /><span style="font-weight: bold;"> for(int i=1;i<=5;i++){</span> <br /> <br /><span style="font-weight: bold;"> System.out.println((int)(Math.random()*100));</span> <br /> <br /><span style="font-weight: bold;"> }</span> <br /> <br /><span style="font-weight: bold;"> }</span> <br /> <br /><span style="font-weight: bold;">}</span> <br /> <br /><span style="font-weight: bold;">Program 5</span> <br /> <br /><span style="font-weight: bold;">/* Write a program to display a greet message according to</span> <br /> <br /><span style="font-weight: bold;"> Marks obtained by student.</span> <br /> <br /><span style="font-weight: bold;">*/</span> <br /> <br /><span style="font-weight: bold;">class SwitchDemo{</span> <br /> <br /><span style="font-weight: bold;"> public static void main(String args[]){</span> <br /> <br /><span style="font-weight: bold;"> int marks = Integer.parseInt(args[0]); //take marks as command line argument.</span> <br /> <br /><span style="font-weight: bold;"> switch(marks/10){</span> <br /> <br /><span style="font-weight: bold;"> case 10:</span> <br /> <br /><span style="font-weight: bold;"> case 9:</span> <br /> <br /><span style="font-weight: bold;"> case 8:</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Excellent");</span> <br /> <br /><span style="font-weight: bold;"> break;</span> <br /> <br /><span style="font-weight: bold;"> case 7:</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Very Good");</span> <br /> <br /><span style="font-weight: bold;"> break;</span> <br /> <br /><span style="font-weight: bold;"> case 6:</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Good");</span> <br /> <br /><span style="font-weight: bold;"> break;</span> <br /> <br /><span style="font-weight: bold;"> case 5:</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Work Hard");</span> <br /> <br /><span style="font-weight: bold;"> break;</span> <br /> <br /><span style="font-weight: bold;"> case 4:</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Poor");</span> <br /> <br /><span style="font-weight: bold;"> break;</span> <br /> <br /><span style="font-weight: bold;"> case 3:</span> <br /> <br /><span style="font-weight: bold;"> case 2:</span> <br /> <br /><span style="font-weight: bold;"> case 1:</span> <br /> <br /><span style="font-weight: bold;"> case 0:</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Very Poor");</span> <br /> <br /><span style="font-weight: bold;"> break;</span> <br /> <br /><span style="font-weight: bold;"> default:</span> <br /> <br /><span style="font-weight: bold;"> System.out.println("Invalid value Entered");</span> <br /> <br /><span style="font-weight: bold;"> }</span> <br /> <br /><span style="font-weight: bold;"> }</span> <br /> <br /><span style="font-weight: bold;">}</span> <br /> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/core-java-programs-page-1.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/core-java-programs-page-1.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:32:00-07:00'>1:32 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=1349118309869716074' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=1349118309869716074&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5B%20PAGE%201%5D' rel='tag'>Core Java Programs [ PAGE 1]</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='5519286637694087475' itemprop='postId'/> <a name='5519286637694087475'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/jdbc-programming-examples_18.html'>JDBC Programming Examples</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-5519286637694087475' itemprop='description articleBody'> /* ================================<br />JDBC Programming Examples<br />================================<br /><br /><br /><br /><br />1. Substitute your driver's JDBC URL for the generic JDBC URL<br /> that appears in the code. In other words, put your driver's JDBC URL<br /> between the quotation marks in the follwoing line:<br /><br /> String url = "jdbc:mySubprotocol:myDataSource";<br /><br /> The documentation for your driver should give you this URL.<br /><br />2. Substitute the driver's full class name for "myDriver.ClassName" in<br /> the following line:<br /><br /> Class.forName("myDriver.ClassName");<br /><br />3. Substitute the username and password you use for your database<br /> in the following:<br /><br /> "userid", "password"<br /><br /><br />*/<br /><br /><br />import javax.swing.JOptionPane;<br />import java.sql.*;<br />public class JdbcDemo<br />{<br /> public static void main(String args[])<br /> {<br /> JOptionPane.showMessageDialog(null,"Welcome to JDBC Demo");<br /> int choice = -1;<br /> String userid="scott";<br /> String password = "tiger";<br /><br /> do<br /> {<br /> choice = getChoice();<br /> if (choice != 0)<br /> {<br /> getSelected(choice, userid, password);<br /> }<br /> }<br /> while ( choice != 0);<br /> System.exit(0);<br /> }<br /><br /> public static int getChoice()<br /> {<br /> String choice;<br /> int ch;<br /> choice = JOptionPane.showInputDialog(null,<br /> "1. Create Coffees Table\n"+<br /> "2. Insert Values into Coffees Table\n"+<br /> "3. Create Suppliers Table\n"+<br /> "4. Insert Values into Suppliers Table\n"+<br /> "5. Update Table Example on Coffees Table\n"+<br /> "6. A PreparedStatement Demo On Coffees Table\n"+<br /> "7. A PreparedStatement Demo On Coffees Table using a FOR Statement\n"+<br /> "8. List of the coffees he buys from Acme, Inc [Supplier]\n"+<br /> "9. Using Transactions Demo"+<br /> "10. Creating a Stored Procedue Demo\n"+<br /> "11. Using Callable Statement to call a Stored Procedure\n"+<br /> "12. Batch Update Demo\n"+<br /> "0. Exit\n\n"+<br /> "Enter your choice");<br /> ch = Integer.parseInt(choice);<br /> return ch;<br /><br /> }<br /><br /> public static void getSelected(int choice, String userid, String password)<br /> {<br /> if(choice==1)<br /> {<br /> createCoffees(userid, password);<br /> }<br /> else if(choice==2)<br /> {<br /> insertCoffees(userid, password);<br /> }<br /> else if(choice==3)<br /> {<br /> createSuppliers(userid, password);<br /> }<br /> else if(choice==4)<br /> {<br /> insertSuppliers(userid, password);<br /> }<br /> else if(choice==5)<br /> {<br /> updateCoffees(userid, password);<br /> }<br /> else if(choice==6)<br /> {<br /> prepare1Demo(userid, password);<br /> }<br /> else if(choice==7)<br /> {<br /> prepare2Demo(userid, password);<br /> }<br /> else if(choice==8)<br /> {<br /> joinDemo(userid, password);<br /> }<br /> else if(choice==9)<br /> {<br /> transDemo(userid, password);<br /> }<br /> else if(choice==10)<br /> {<br /> createProcedure1(userid, password);<br /> }<br /> else if(choice==11)<br /> {<br /> callableDemo(userid, password);<br /> }<br /> else if(choice==12)<br /> {<br /> batchUpdateDemo(userid, password);<br /> }<br /> }<br /><br /> // Create Coffees Table<br /> public static void createCoffees(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob"; // String url = "jdbc:mySubprotocol:myDataSource"; ?<br /> // jdbc:subprotocol:subname<br /> Connection con;<br /> String createString;<br /> createString = "create table COFFEES " +<br /> "(COF_NAME varchar(32), " +<br /> "SUP_ID int, " +<br /> "PRICE float, " +<br /> "SALES int, " +<br /> "TOTAL int)";<br /> Statement stmt;<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //Class.forName("myDriver.ClassName"); ?<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /><br /> stmt = con.createStatement();<br /> stmt.executeUpdate(createString);<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /> }<br /><br /> // Insert values into Coffees Table<br /> public static void insertCoffees(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /> Statement stmt;<br /> String query = "select COF_NAME, PRICE from COFFEES";<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /><br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /><br /> stmt = con.createStatement();<br /><br /> stmt.executeUpdate("insert into COFFEES " +<br /> "values('Colombian', 00101, 7.99, 0, 0)");<br /><br /> stmt.executeUpdate("insert into COFFEES " +<br /> "values('French_Roast', 00049, 8.99, 0, 0)");<br /><br /> stmt.executeUpdate("insert into COFFEES " +<br /> "values('Espresso', 00150, 9.99, 0, 0)");<br /><br /> stmt.executeUpdate("insert into COFFEES " +<br /> "values('Colombian_Decaf', 00101, 8.99, 0, 0)");<br /><br /> stmt.executeUpdate("insert into COFFEES " +<br /> "values('French_Roast_Decaf', 00049, 9.99, 0, 0)");<br /><br /> ResultSet rs = stmt.executeQuery(query);<br /><br /> System.out.println("Coffee Break Coffees and Prices:");<br /> while (rs.next()) {<br /> String s = rs.getString("COF_NAME"); // OR rs.getString(1);<br /> float f = rs.getFloat("PRICE"); // OR rs.getFloat(3);<br /> System.out.println(s + " " + f);<br /> }<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /> }<br /><br /><br /> // Create Suppliers Table<br /> public static void createSuppliers(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /> String createString;<br /> createString = "create table SUPPLIERS " +<br /> "(SUP_ID int, " +<br /> "SUP_NAME varchar(40), " +<br /> "STREET varchar(40), " +<br /> "CITY varchar(20), " +<br /> "STATE char(2), ZIP char(5))";<br /><br /> Statement stmt;<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /><br /> stmt = con.createStatement();<br /> stmt.executeUpdate(createString);<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /> }<br /><br /> // Insert values into Coffees Table<br /> public static void insertSuppliers(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /> Statement stmt;<br /> String query = "select SUP_NAME, SUP_ID from SUPPLIERS";<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /><br /> stmt = con.createStatement();<br /><br /> stmt.executeUpdate("insert into SUPPLIERS " +<br /> "values(49, 'Superior Coffee', '1 Party Place', " +<br /> "'Mendocino', 'CA', '95460')");<br /><br /> stmt.executeUpdate("insert into SUPPLIERS " +<br /> "values(101, 'Acme, Inc.', '99 Market Street', " +<br /> "'Groundsville', 'CA', '95199')");<br /><br /> stmt.executeUpdate("insert into SUPPLIERS " +<br /> "values(150, 'The High Ground', '100 Coffee Lane', " +<br /> "'Meadows', 'CA', '93966')");<br /><br /> ResultSet rs = stmt.executeQuery(query);<br /><br /> System.out.println("Suppliers and their ID Numbers:");<br /> while (rs.next()) {<br /> String s = rs.getString("SUP_NAME");<br /> int n = rs.getInt("SUP_ID");<br /> System.out.println(s + " " + n);<br /> }<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /> }<br /><br /><br /> // Update Coffees Table<br /> public static void updateCoffees(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /> String updateString;<br /> updateString = "UPDATE COFFEES " +<br /> "SET SALES = 75 " +<br /> "WHERE COF_NAME LIKE 'Colombian'";<br /><br /> String query = "SELECT COF_NAME, SALES FROM COFFEES " +<br /> "WHERE COF_NAME LIKE 'Colombian'";<br /><br /> Statement stmt;<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /><br /> stmt = con.createStatement();<br /> stmt.executeUpdate(updateString);<br /><br /> ResultSet rs = stmt.executeQuery(query);<br /> while (rs.next()) {<br /> String s = rs.getString("COF_NAME"); //1<br /> int n = rs.getInt("SALES"); //2<br /> System.out.println(n + " pounds of " + s +<br /> " sold this week.");<br /> }<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /> }<br /><br /> // Update Coffees Table using a prepared Statement<br /> public static void prepare1Demo(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /><br /> Statement stmt=null;<br /> String query = "SELECT COF_NAME, SALES FROM COFFEES ";<br /><br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /><br /> PreparedStatement updateSales = con.prepareStatement(<br /> "UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ? ");<br /> updateSales.setInt(1, 75);<br /> updateSales.setString(2, "Colombian");<br /> updateSales.executeUpdate();<br /><br /><br /> ResultSet rs = stmt.executeQuery(query);<br /> while (rs.next()) {<br /> String s = rs.getString("COF_NAME"); //1<br /> int n = rs.getInt("SALES"); //2<br /> System.out.println(s + " " + n);<br /> }<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /> }<br /><br /> // Update Coffees Table using a prepared Statement<br /> public static void prepare2Demo(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /><br /> Statement stmt=null;<br /> String query = "SELECT COF_NAME, SALES FROM COFFEES ";<br /><br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /><br /> PreparedStatement updateSales;<br /> String updateString = "update COFFEES " +<br /> "set SALES = ? where COF_NAME like ?";<br /> updateSales = con.prepareStatement(updateString);<br /> int [] salesForWeek = {175, 150, 60, 155, 90};<br /> String [] coffees = {"Colombian", "French_Roast", "Espresso",<br /> "Colombian_Decaf", "French_Roast_Decaf"};<br /> int len = coffees.length;<br /> for(int i = 0; i < len; i++) {<br /> updateSales.setInt(1, salesForWeek[i]);<br /> updateSales.setString(2, coffees[i]);<br /> updateSales.executeUpdate();<br /><br /> // int n= updateSales.executeUpdate() to find out how may rows have been updated<br /> }<br /><br /><br /><br /> ResultSet rs = stmt.executeQuery(query);<br /> while (rs.next()) {<br /> String s = rs.getString("COF_NAME"); //1<br /> int n = rs.getInt("SALES"); //2<br /> System.out.println(s + " " + n);<br /> }<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /> }<br /><br /> //Using join on 2 table to retrieve results<br /> public static void joinDemo(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /> String query = "select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME " +<br /> "from COFFEES, SUPPLIERS " +<br /> "where SUPPLIERS.SUP_NAME like 'Acme, Inc.' and " +<br /> "SUPPLIERS.SUP_ID = COFFEES.SUP_ID";<br /> Statement stmt;<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /> con = DriverManager.getConnection (url,<br /> "userid", "password");<br /><br /> stmt = con.createStatement();<br /><br /> ResultSet rs = stmt.executeQuery(query);<br /> System.out.println("Supplier, Coffee:");<br /> while (rs.next()) {<br /> String supName = rs.getString(1);<br /> String cofName = rs.getString(2);<br /> System.out.println(" " + supName + ", " + cofName);<br /> }<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.print("SQLException: ");<br /> System.err.println(ex.getMessage());<br /> }<br /> }<br /><br /> // Using Transaction Autocommit Option<br /> public static void transDemo(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con=null;<br /> Statement stmt;<br /> PreparedStatement updateSales;<br /> PreparedStatement updateTotal;<br /> String updateString = "update COFFEES " +<br /> "set SALES = ? where COF_NAME = ?";<br /><br /> String updateStatement = "update COFFEES " +<br /> "set TOTAL = TOTAL + ? where COF_NAME = ?";<br /> String query = "select COF_NAME, SALES, TOTAL from COFFEES";<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /><br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /><br /> updateSales = con.prepareStatement(updateString);<br /> updateTotal = con.prepareStatement(updateStatement);<br /> int [] salesForWeek = {175, 150, 60, 155, 90};<br /> String [] coffees = {"Colombian", "French_Roast",<br /> "Espresso", "Colombian_Decaf",<br /> "French_Roast_Decaf"};<br /> int len = coffees.length;<br /> con.setAutoCommit(false);<br /> for (int i = 0; i < len; i++) {<br /> updateSales.setInt(1, salesForWeek[i]);<br /> updateSales.setString(2, coffees[i]);<br /> updateSales.executeUpdate();<br /><br /> updateTotal.setInt(1, salesForWeek[i]);<br /> updateTotal.setString(2, coffees[i]);<br /> updateTotal.executeUpdate();<br /> con.commit();<br /> }<br /><br /> con.setAutoCommit(true);<br /><br /> updateSales.close();<br /> updateTotal.close();<br /><br /> stmt = con.createStatement();<br /> ResultSet rs = stmt.executeQuery(query);<br /><br /> while (rs.next()) {<br /> String c = rs.getString("COF_NAME");<br /> int s = rs.getInt("SALES");<br /> int t = rs.getInt("TOTAL");<br /> System.out.println(c + " " + s + " " + t);<br /> }<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> if (con != null) {<br /> try {<br /> System.err.print("Transaction is being ");<br /> System.err.println("rolled back");<br /> con.rollback();<br /> } catch(SQLException excep) {<br /> System.err.print("SQLException: ");<br /> System.err.println(excep.getMessage());<br /> }<br /> }<br /> }<br /> }<br /><br /> /*Creating a Stored procedure involving the coffees and the suppliers table<br /><br /> create procedure SHOW_SUPPLIERS<br /> as<br /> select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME<br /> from SUPPLIERS, COFFEES<br /> where SUPPLIERS.SUP_ID = COFFEES.SUP_ID<br /> order by SUP_NAME<br /> */<br /><br /> public static void createProcedure1(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /> Statement stmt;<br /> String createProcedure = "create procedure SHOW_SUPPLIERS " +<br /> "as " +<br /> "select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME " +<br /> "from SUPPLIERS, COFFEES " +<br /> "where SUPPLIERS.SUP_ID = COFFEES.SUP_ID " +<br /> "order by SUP_NAME";<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /> try {<br /> con = DriverManager.getConnection(url,<br /> "DPST_TRNG", "DPST_TRNG4321");<br /><br /> stmt = con.createStatement();<br /> stmt.executeUpdate(createProcedure);<br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /><br /> }<br /><br /><br /> //Using Callable Statement to call a Stored Procedure<br /> public static void callableDemo(String userid, String password)<br /> {<br /> String url = "jdbc:odbc:bob";<br /> Connection con;<br /> Statement stmt=null;<br /><br /> try {<br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /> try {<br /> con = DriverManager.getConnection(url,<br /> "DPST_TRNG", "DPST_TRNG4321");<br /><br /><br /> CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");<br /> ResultSet rs = cs.executeQuery();<br /><br /> while (rs.next()) {<br /> String c = rs.getString("SUP_NAME");<br /> String s = rs.getString("COF_NAME");<br /> System.out.println(c + " " + s );<br /> }<br /><br /> stmt.close();<br /> con.close();<br /><br /> } catch(SQLException ex) {<br /> System.err.println("SQLException: " + ex.getMessage());<br /> }<br /><br /> }<br /><br /> //A code showing the Batch Update Syntax<br /> public static void batchUpdateDemo(String userid, String password)<br /> {<br /> ResultSet rs = null;<br /> PreparedStatement ps = null;<br /><br /> String url = "jdbc:odbc:bob";<br /><br /> Connection con;<br /> Statement stmt;<br /> try {<br /><br /> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");<br /><br /> } catch(java.lang.ClassNotFoundException e) {<br /> System.err.print("ClassNotFoundException: ");<br /> System.err.println(e.getMessage());<br /> }<br /><br /> try {<br /><br /> con = DriverManager.getConnection(url,<br /> "userid", "password");<br /> con.setAutoCommit(false);<br /><br /> stmt = con.createStatement();<br /><br /> stmt.addBatch("INSERT INTO COFFEES " +<br /> "VALUES('Amaretto', 49, 9.99, 0, 0)");<br /> stmt.addBatch("INSERT INTO COFFEES " +<br /> "VALUES('Hazelnut', 49, 9.99, 0, 0)");<br /> stmt.addBatch("INSERT INTO COFFEES " +<br /> "VALUES('Amaretto_decaf', 49, 10.99, 0, 0)");<br /> stmt.addBatch("INSERT INTO COFFEES " +<br /> "VALUES('Hazelnut_decaf', 49, 10.99, 0, 0)");<br /> int [] updateCounts = stmt.executeBatch();<br /> con.commit();<br /> con.setAutoCommit(true);<br /><br /> ResultSet uprs = stmt.executeQuery("SELECT * FROM COFFEES");<br /><br /> System.out.println("Table COFFEES after insertion:");<br /> while (uprs.next()) {<br /> String name = uprs.getString("COF_NAME");<br /> int id = uprs.getInt("SUP_ID");<br /> float price = uprs.getFloat("PRICE");<br /> int sales = uprs.getInt("SALES");<br /> int total = uprs.getInt("TOTAL");<br /> System.out.print(name + " " + id + " " + price);<br /> System.out.println(" " + sales + " " + total);<br /> }<br /><br /> uprs.close();<br /> stmt.close();<br /> con.close();<br /><br /> } catch(BatchUpdateException b) {<br /> System.err.println("-----BatchUpdateException-----");<br /> System.err.println("SQLState: " + b.getSQLState());<br /> System.err.println("Message: " + b.getMessage());<br /> System.err.println("Vendor: " + b.getErrorCode());<br /> System.err.print("Update counts: ");<br /> int [] updateCounts = b.getUpdateCounts();<br /> for (int i = 0; i < updateCounts.length; i++) {<br /> System.err.print(updateCounts[i] + " ");<br /> }<br /> System.err.println("");<br /><br /> } catch(SQLException ex) {<br /> System.err.println("-----SQLException-----");<br /> System.err.println("SQLState: " + ex.getSQLState());<br /> System.err.println("Message: " + ex.getMessage());<br /> System.err.println("Vendor: " + ex.getErrorCode());<br /> }<br /> }<br /><br /><br />}//End of class <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/jdbc-programming-examples_18.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/jdbc-programming-examples_18.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:26:00-07:00'>1:26 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=5519286637694087475' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=5519286637694087475&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/JDBC%20Programming%20Examples' rel='tag'>JDBC Programming Examples</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='2789343346757193234' itemprop='postId'/> <a name='2789343346757193234'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/jdbc-programming-examples.html'>JDBC Programming</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-2789343346757193234' itemprop='description articleBody'> <a href="http://data--center.blogspot.com/javaprogram">JDBC Programming Examples</a> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/jdbc-programming-examples.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/jdbc-programming-examples.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:21:00-07:00'>1:21 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=2789343346757193234' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=2789343346757193234&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/JDBC%20Programming' rel='tag'>JDBC Programming</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='161627700135822200' itemprop='blogId'/> <meta content='906555059922090678' itemprop='postId'/> <a name='906555059922090678'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://data-dump.blogspot.com/2008/04/javaj2ee-programmer-practice-test-1.html'>Java/J2EE Programmer Practice Test 1</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-906555059922090678' itemprop='description articleBody'> <span style="font-weight: bold;"></span><br /><br /><br /><span style="font-weight: bold;">1. Which of the following are valid definitions of an application's main( ) method?</span><br /><br /><span style="font-weight: bold;">a) public static void main();</span><br /><span style="font-weight: bold;">b) public static void main( String args );</span><br /><span style="font-weight: bold;">c) public static void main( String args[] );</span><br /><span style="font-weight: bold;">d) public static void main( Graphics g );</span><br /><span style="font-weight: bold;">e) public static boolean main( String args[] );</span><br /><br /><br /><br /><span style="font-weight: bold;">2. If MyProg.java were compiled as an application and then run from the command line as: </span><br /><span style="font-weight: bold;">java MyProg I like tests</span><br /><span style="font-weight: bold;">what would be the value of args[ 1 ] inside the main( ) method?</span><br /><br /><span style="font-weight: bold;">a) MyProg</span><br /><span style="font-weight: bold;">b) "I"</span><br /><span style="font-weight: bold;">c) "like"</span><br /><span style="font-weight: bold;">d) 3</span><br /><span style="font-weight: bold;">e) 4</span><br /><span style="font-weight: bold;">f) null until a value is assigned</span><br /><br /><br /><br /><span style="font-weight: bold;">3. Which of the following are Java keywords?</span><br /><br /><span style="font-weight: bold;">a) array</span><br /><span style="font-weight: bold;">b) boolean</span><br /><span style="font-weight: bold;">c) Integer</span><br /><span style="font-weight: bold;">d) protect</span><br /><span style="font-weight: bold;">e) super</span><br /><br /><br /><br /><span style="font-weight: bold;">4. After the declaration: </span><br /><span style="font-weight: bold;">char[] c = new char[100]; </span><br /><span style="font-weight: bold;">what is the value of c[50]?</span><br /><br /><span style="font-weight: bold;">a) 50</span><br /><span style="font-weight: bold;">b) 49</span><br /><span style="font-weight: bold;">c) '\u0000'</span><br /><span style="font-weight: bold;">d) '\u0020'</span><br /><span style="font-weight: bold;">e) " "</span><br /><span style="font-weight: bold;">f) cannot be determined</span><br /><span style="font-weight: bold;">g) always null until a value is assigned</span><br /><br /><br /><span style="font-weight: bold;">5. After the declaration: </span><br /><span style="font-weight: bold;">int x; </span><br /><span style="font-weight: bold;">the range of x is:</span><br /><br /><span style="font-weight: bold;">a) -231 to 231-1 </span><br /><span style="font-weight: bold;">b) -216 to 216 - 1 </span><br /><span style="font-weight: bold;">c) -232 to 232 </span><br /><span style="font-weight: bold;">d) -216 to 216</span><br /><span style="font-weight: bold;">e) cannot be determined; it depends on the machine</span><br /><br /><br /><span style="font-weight: bold;">6. Which identifiers are valid?</span><br /><br /><span style="font-weight: bold;">a) _xpoints</span><br /><span style="font-weight: bold;">b) r2d2</span><br /><span style="font-weight: bold;">c) bBb$</span><br /><span style="font-weight: bold;">d) set-flow</span><br /><span style="font-weight: bold;">e) thisisCrazy</span><br /><br /><br /><span style="font-weight: bold;">7. Represent the number 6 as a hexadecimal literal.</span><br /><br /><br /><br /><br /><span style="font-weight: bold;">8. Which of the following statements assigns "Hello Java" to the String variable s?</span><br /><br /><span style="font-weight: bold;">a) String s = "Hello Java";</span><br /><span style="font-weight: bold;">b) String s[] = "Hello Java";</span><br /><span style="font-weight: bold;">c) new String s = "Hello Java";</span><br /><span style="font-weight: bold;">d) String s = new String("Hello Java");</span><br /><br /><br /><span style="font-weight: bold;">9. An integer, x has a binary value (using 1 byte) of 10011100. What is the binary value of z after these statements: </span><br /><span style="font-weight: bold;">int y = 1 <<><br /><span style="font-weight: bold;">int z = x & y; </span><br /><br /><span style="font-weight: bold;">a) 1000 0001</span><br /><span style="font-weight: bold;">b) 1000 0000</span><br /><span style="font-weight: bold;">c) 0000 0001</span><br /><span style="font-weight: bold;">d) 1001 1101</span><br /><span style="font-weight: bold;">e) 1001 1100</span><br /><br /><br /><span style="font-weight: bold;">10. Which statements are accurate:</span><br /><br /><span style="font-weight: bold;">a) >> performs signed shift while >>> performs an unsigned shift.</span><br /><span style="font-weight: bold;">b) >>> performs a signed shift while >> performs an unsigned shift.</span><br /><span style="font-weight: bold;">c) <<><br /><span style="font-weight: bold;">d) <<<><br /><br /><br /><span style="font-weight: bold;">11. The statement ... </span><br /><span style="font-weight: bold;">String s = "Hello" + "Java"; </span><br /><span style="font-weight: bold;">yields the same value for s as ... </span><br /><span style="font-weight: bold;">String s = "Hello";</span><br /><span style="font-weight: bold;">String s2= "Java";</span><br /><span style="font-weight: bold;">s.concat( s2 ); </span><br /><span style="font-weight: bold;">True</span><br /><span style="font-weight: bold;">False</span><br /><br /><br /><span style="font-weight: bold;">12. If you compile and execute an application with the following code in its main() method:</span><br /><span style="font-weight: bold;">String s = new String( "Computer" );</span><br /><br /><span style="font-weight: bold;">if( s == "Computer" )</span><br /><span style="font-weight: bold;">System.out.println( "Equal A" );</span><br /><span style="font-weight: bold;">if( s.equals( "Computer" ) )</span><br /><span style="font-weight: bold;">System.out.println( "Equal B" );</span><br /><span style="font-weight: bold;">a) It will not compile because the String class does not support the = = operator.</span><br /><span style="font-weight: bold;">b) It will compile and run, but nothing is printed.</span><br /><span style="font-weight: bold;">c) "Equal A" is the only thing that is printed.</span><br /><span style="font-weight: bold;">d) "Equal B" is the only thing that is printed.</span><br /><span style="font-weight: bold;">e) Both "Equal A" and "Equal B" are printed.</span><br /><br /><br /><span style="font-weight: bold;">13. Consider the two statements:</span><br /><span style="font-weight: bold;">1. boolean passingScore = false && grade == 70;</span><br /><span style="font-weight: bold;">2. boolean passingScore = false & grade == 70;</span><br /><span style="font-weight: bold;">The expression </span><br /><span style="font-weight: bold;">grade == 70 </span><br /><span style="font-weight: bold;">is evaluated:</span><br /><br /><span style="font-weight: bold;">a) in both 1 and 2</span><br /><span style="font-weight: bold;">b) in neither 1 nor 2</span><br /><span style="font-weight: bold;">c) in 1 but not 2</span><br /><span style="font-weight: bold;">d) in 2 but not 1</span><br /><span style="font-weight: bold;">e) invalid because false should be FALSE</span><br /><br /><br /><span style="font-weight: bold;">14. Given the variable declarations below: </span><br /><span style="font-weight: bold;">byte myByte;</span><br /><span style="font-weight: bold;">int myInt;</span><br /><span style="font-weight: bold;">long myLong;</span><br /><span style="font-weight: bold;">char myChar;</span><br /><span style="font-weight: bold;">float myFloat;</span><br /><span style="font-weight: bold;">double myDouble; </span><br /><span style="font-weight: bold;">Which one of the following assignments would need an explicit cast?</span><br /><br /><span style="font-weight: bold;">a) myInt = myByte;</span><br /><span style="font-weight: bold;">b) myInt = myLong;</span><br /><span style="font-weight: bold;">c) myByte = 3;</span><br /><span style="font-weight: bold;">d) myInt = myChar;</span><br /><span style="font-weight: bold;">e) myFloat = myDouble;</span><br /><span style="font-weight: bold;">f) myFloat = 3;</span><br /><span style="font-weight: bold;">g) myDouble = 3.0;</span><br /><br /><br /><br /><span style="font-weight: bold;">15. Consider this class example:</span><br /><span style="font-weight: bold;">class MyPoint </span><br /><span style="font-weight: bold;">{ void myMethod() </span><br /><span style="font-weight: bold;">{ int x, y;</span><br /><span style="font-weight: bold;">x = 5; y = 3;</span><br /><span style="font-weight: bold;">System.out.print( " ( " + x + ", " + y + " ) " );</span><br /><span style="font-weight: bold;">switchCoords( x, y );</span><br /><span style="font-weight: bold;">System.out.print( " ( " + x + ", " + y + " ) " );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">void switchCoords( int x, int y ) </span><br /><span style="font-weight: bold;">{ int temp;</span><br /><span style="font-weight: bold;">temp = x;</span><br /><span style="font-weight: bold;">x = y;</span><br /><span style="font-weight: bold;">y = temp;</span><br /><span style="font-weight: bold;">System.out.print( " ( " + x + ", " + y + " ) " );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">What is printed to standard output if myMethod() is executed?</span><br /><br /><span style="font-weight: bold;">a) (5, 3) (5, 3) (5, 3)</span><br /><span style="font-weight: bold;">b) (5, 3) (3, 5) (3, 5)</span><br /><span style="font-weight: bold;">c) (5, 3) (3, 5) (5, 3)</span><br /><br /><br /><span style="font-weight: bold;">16. To declare an array of 31 floating point numbers representing snowfall for each day of March in Gnome, Alaska, which declarations would be valid?</span><br /><br /><span style="font-weight: bold;">a) double snow[] = new double[31];</span><br /><span style="font-weight: bold;">b) double snow[31] = new array[31];</span><br /><span style="font-weight: bold;">c) double snow[31] = new array;</span><br /><span style="font-weight: bold;">d) double[] snow = new double[31];</span><br /><br /><br /><span style="font-weight: bold;">17. If arr[] contains only positive integer values, what does this function do?</span><br /><span style="font-weight: bold;">public int guessWhat( int arr[] )</span><br /><span style="font-weight: bold;">{ int x= 0;</span><br /><span style="font-weight: bold;">for( int i = 0; i <><br /><span style="font-weight: bold;">x = x <><br /><span style="font-weight: bold;">return x;</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">a) Returns the index of the highest element in the array</span><br /><span style="font-weight: bold;">b) Returns true/false if there are any elements that repeat in the array</span><br /><span style="font-weight: bold;">c) Returns how many even numbers are in the array</span><br /><span style="font-weight: bold;">d) Returns the highest element in the array</span><br /><span style="font-weight: bold;">e) Returns the number of question marks in the array</span><br /><br /><br /><span style="font-weight: bold;">18. Consider the code below: </span><br /><span style="font-weight: bold;">arr[0] = new int[4];</span><br /><span style="font-weight: bold;">arr[1] = new int[3];</span><br /><span style="font-weight: bold;">arr[2] = new int[2];</span><br /><span style="font-weight: bold;">arr[3] = new int[1];</span><br /><span style="font-weight: bold;">for( int n = 0; n <><br /><span style="font-weight: bold;">System.out.println( /* what goes here? */ ); </span><br /><span style="font-weight: bold;">Which statement below, when inserted as the body of the for loop, would print the number of values in each row?</span><br /><br /><span style="font-weight: bold;">a) arr[n].length();</span><br /><span style="font-weight: bold;">b) arr.size;</span><br /><span style="font-weight: bold;">c) arr.size -1;</span><br /><span style="font-weight: bold;">d) arr[n][size];</span><br /><span style="font-weight: bold;">e) arr[n].length;</span><br /><br /><br /><span style="font-weight: bold;">19. If size = 4, triArray looks like:</span><br /><br /><span style="font-weight: bold;">int[][] makeArray( int size) </span><br /><span style="font-weight: bold;">{ int[][] triArray = new int[size] [];</span><br /><span style="font-weight: bold;">int val=1;</span><br /><span style="font-weight: bold;">for( int i = 0; i <><br /><span style="font-weight: bold;">{ triArray[i] = new int[i+1];</span><br /><span style="font-weight: bold;">for( int j=0; j <><br /><span style="font-weight: bold;">{ triArray[i][j] = val++;</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">return triArray;</span><br /><span style="font-weight: bold;">}</span><br /><br /><span style="font-weight: bold;">a) </span><br /><span style="font-weight: bold;">1 2 3 4</span><br /><span style="font-weight: bold;">5 6 7</span><br /><span style="font-weight: bold;">8 9</span><br /><span style="font-weight: bold;">10</span><br /><span style="font-weight: bold;">b) </span><br /><span style="font-weight: bold;">1 4 9 16</span><br /><span style="font-weight: bold;">c) </span><br /><span style="font-weight: bold;">1 2 3 4</span><br /><span style="font-weight: bold;">d) </span><br /><span style="font-weight: bold;">1 2 3 4</span><br /><span style="font-weight: bold;">5 6 7 8</span><br /><span style="font-weight: bold;">9 10 11 12</span><br /><span style="font-weight: bold;">13 14 15 16</span><br /><span style="font-weight: bold;">e) </span><br /><span style="font-weight: bold;">1</span><br /><span style="font-weight: bold;">2 3 </span><br /><span style="font-weight: bold;">4 5 6 </span><br /><span style="font-weight: bold;">7 8 9 10</span><br /><span style="font-weight: bold;">20. Which of the following are legal declarations of a two-dimensional array of integers?</span><br /><br /><span style="font-weight: bold;">a) int[5][5]a = new int[][];</span><br /><span style="font-weight: bold;">b) int a = new int[5,5]; </span><br /><span style="font-weight: bold;">c) int[]a[] = new int[5][5];</span><br /><span style="font-weight: bold;">d) int[][]a = new[5]int[5];</span><br /><br /><br /><span style="font-weight: bold;">21. Which of the following are correct methods for initializing the array "dayhigh" with 7 values?</span><br /><br /><span style="font-weight: bold;">a) int dayhigh = { 24, 23, 24, 25, 25, 23, 21 };</span><br /><span style="font-weight: bold;">b) int dayhigh[] = { 24, 23, 24, 25, 25, 23, 21 };</span><br /><span style="font-weight: bold;">c) int[] dayhigh = { 24, 23, 24, 25, 25, 23, 21 };</span><br /><span style="font-weight: bold;">d) int dayhigh [] = new int[24, 23, 24, 25, 25, 23, 21];</span><br /><span style="font-weight: bold;">e) int dayhigh = new[24, 23, 24, 25, 25, 23, 21];</span><br /><br /><br /><span style="font-weight: bold;">22. If you want subclasses to access, but not to override a superclass member method, what keyword should precede the name of the superclass method?</span><br /><br /><br /><br /><br /><span style="font-weight: bold;">23. If you want a member variable to not be accessible outside the current class at all, what keyword should precede the name of the variable when declaring it?</span><br /><br /><br /><br /><br /><span style="font-weight: bold;">24. Consider the code below:</span><br /><br /><span style="font-weight: bold;">public static void main( String args[] )</span><br /><span style="font-weight: bold;">{ int a = 5;</span><br /><span style="font-weight: bold;">System.out.println( cube( a ) );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">int cube( int theNum )</span><br /><span style="font-weight: bold;">{</span><br /><span style="font-weight: bold;">return theNum * theNum * theNum;</span><br /><span style="font-weight: bold;">}</span><br /><br /><span style="font-weight: bold;">What will happen when you attempt to compile and run this code?</span><br /><br /><span style="font-weight: bold;">a) It will not compile because cube is already defined in the java.lang.Math class.</span><br /><span style="font-weight: bold;">b) It will not compile because cube is not static.</span><br /><span style="font-weight: bold;">c) It will compile, but throw an arithmetic exception.</span><br /><span style="font-weight: bold;">d) It will run perfectly and print "125" to standard output.</span><br /><br /><br /><span style="font-weight: bold;">25. Given the variables defined below: </span><br /><span style="font-weight: bold;">int one = 1;</span><br /><span style="font-weight: bold;">int two = 2;</span><br /><span style="font-weight: bold;">char initial = '2';</span><br /><span style="font-weight: bold;">boolean flag = true; </span><br /><span style="font-weight: bold;">Which of the following are valid?</span><br /><br /><span style="font-weight: bold;">a) if( one ){}</span><br /><span style="font-weight: bold;">b) if( one = two ){}</span><br /><span style="font-weight: bold;">c) if( one == two ){}</span><br /><span style="font-weight: bold;">d) if( flag ){}</span><br /><span style="font-weight: bold;">e) switch( one ){}</span><br /><span style="font-weight: bold;">f) switch( flag ){}</span><br /><span style="font-weight: bold;">g) switch( initial ){}</span><br /><br /><br /><span style="font-weight: bold;">26. If val = 1 in the code below:</span><br /><br /><span style="font-weight: bold;">switch( val ) </span><br /><span style="font-weight: bold;">{ case 1: System.out.print( "P" );</span><br /><span style="font-weight: bold;">case 2: </span><br /><span style="font-weight: bold;">case 3: System.out.print( "Q" );</span><br /><span style="font-weight: bold;">break;</span><br /><span style="font-weight: bold;">case 4: System.out.print( "R" );</span><br /><span style="font-weight: bold;">default: System.out.print( "S" );</span><br /><span style="font-weight: bold;">}</span><br /><br /><span style="font-weight: bold;">Which values would be printed?</span><br /><br /><span style="font-weight: bold;">a) P</span><br /><span style="font-weight: bold;">b) Q</span><br /><span style="font-weight: bold;">c) R</span><br /><span style="font-weight: bold;">d) S</span><br /><br /><br /><span style="font-weight: bold;">27. Assume that val has been defined as an int for the code below:</span><br /><br /><span style="font-weight: bold;">if( val > 4 ) </span><br /><span style="font-weight: bold;">{ System.out.println( "Test A" );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">else if( val > 9 ) </span><br /><span style="font-weight: bold;">{ System.out.println( "Test B" );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">else System.out.println( "Test C" );</span><br /><br /><span style="font-weight: bold;">Which values of val will result in "Test C" being printed:</span><br /><span style="font-weight: bold;">a) val <><br /><span style="font-weight: bold;">b) val between 0 and 4 </span><br /><span style="font-weight: bold;">c) val between 4 and 9 </span><br /><span style="font-weight: bold;">d) val > 9 </span><br /><span style="font-weight: bold;">e) val = 0 </span><br /><span style="font-weight: bold;">f) no values for val will be satisfactory</span><br /><span style="font-weight: bold;">28. What exception might a wait() method throw?</span><br /><br /><br /><br /><br /><span style="font-weight: bold;">29. For the code:</span><br /><br /><span style="font-weight: bold;">m = 0;</span><br /><span style="font-weight: bold;">while( m++ <><br /><span style="font-weight: bold;">System.out.println( m );</span><br /><br /><span style="font-weight: bold;">Which of the following are printed to standard output?</span><br /><br /><span style="font-weight: bold;">a) 0</span><br /><span style="font-weight: bold;">b) 1</span><br /><span style="font-weight: bold;">c) 2</span><br /><span style="font-weight: bold;">d) 3</span><br /><span style="font-weight: bold;">e) Nothing and an exception is thrown</span><br /><br /><br /><span style="font-weight: bold;">30. Consider the code fragment below:</span><br /><br /><span style="font-weight: bold;">outer: for( int i = 1; i <3;><br /><span style="font-weight: bold;">{ inner: for( j = 1; j <><br /><span style="font-weight: bold;">{ if( j==2 )</span><br /><span style="font-weight: bold;">continue outer;</span><br /><span style="font-weight: bold;">System.out.println( "i = " +i ", j = " + j );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">} </span><br /><br /><span style="font-weight: bold;">Which of the following would be printed to standard output?</span><br /><br /><span style="font-weight: bold;">a) i = 1, j = 1</span><br /><span style="font-weight: bold;">b) i = 1, j = 2</span><br /><span style="font-weight: bold;">c) i = 1, j = 3</span><br /><span style="font-weight: bold;">d) i = 2, j = 1</span><br /><span style="font-weight: bold;">e) i = 2, j = 2</span><br /><span style="font-weight: bold;">f) i = 2, j = 3</span><br /><span style="font-weight: bold;">g) i = 3, j = 1</span><br /><span style="font-weight: bold;">h) i = 3, j = 2</span><br /><br /><br /><span style="font-weight: bold;">31. Consider the code below:</span><br /><span style="font-weight: bold;">void myMethod() </span><br /><span style="font-weight: bold;">{ try </span><br /><span style="font-weight: bold;">{ </span><br /><span style="font-weight: bold;">fragile();</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">catch( NullPointerException npex ) </span><br /><span style="font-weight: bold;">{ </span><br /><span style="font-weight: bold;">System.out.println( "NullPointerException thrown " );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">catch( Exception ex ) </span><br /><span style="font-weight: bold;">{ </span><br /><span style="font-weight: bold;">System.out.println( "Exception thrown " );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">finally </span><br /><span style="font-weight: bold;">{ </span><br /><span style="font-weight: bold;">System.out.println( "Done with exceptions " ); </span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">System.out.println( "myMethod is done" );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">What is printed to standard output if fragile() throws an IllegalArgumentException?</span><br /><br /><span style="font-weight: bold;">a) "NullPointerException thrown"</span><br /><span style="font-weight: bold;">b) "Exception thrown"</span><br /><span style="font-weight: bold;">c) "Done with exceptions"</span><br /><span style="font-weight: bold;">d) "myMethod is done"</span><br /><span style="font-weight: bold;">e) Nothing is printed</span><br /><br /><br /><span style="font-weight: bold;">32. Consider the following code sample:</span><br /><span style="font-weight: bold;">class Tree{}</span><br /><span style="font-weight: bold;">class Pine extends Tree{}</span><br /><span style="font-weight: bold;">class Oak extends Tree{}</span><br /><span style="font-weight: bold;">public class Forest </span><br /><span style="font-weight: bold;">{ public static void main( String[] args ) </span><br /><span style="font-weight: bold;">{ Tree tree = new Pine();</span><br /><br /><span style="font-weight: bold;">if( tree instanceof Pine )</span><br /><span style="font-weight: bold;">System.out.println( "Pine" );</span><br /><br /><span style="font-weight: bold;">if( tree instanceof Tree )</span><br /><span style="font-weight: bold;">System.out.println( "Tree" );</span><br /><br /><span style="font-weight: bold;">if( tree instanceof Oak )</span><br /><span style="font-weight: bold;">System.out.println( "Oak" );</span><br /><br /><span style="font-weight: bold;">else System.out.println( "Oops" );</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">}</span><br /><span style="font-weight: bold;">Select all choices that will be printed:</span><br /><br /><span style="font-weight: bold;">a) Pine</span><br /><span style="font-weight: bold;">b) Tree</span><br /><span style="font-weight: bold;">c) Forest</span><br /><span style="font-weight: bold;">d) Oops</span><br /><span style="font-weight: bold;">e) (nothing printed).</span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/12309791003951377157' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' title='author profile'> <span itemprop='name'>RAVI CHOPRA</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://data-dump.blogspot.com/2008/04/javaj2ee-programmer-practice-test-1.html' itemprop='url'/> <a class='timestamp-link' href='https://data-dump.blogspot.com/2008/04/javaj2ee-programmer-practice-test-1.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-04-18T01:12:00-07:00'>1:12 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://www.blogger.com/comment.g?blogID=161627700135822200&postID=906555059922090678' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1724816456'> <a href='https://www.blogger.com/post-edit.g?blogID=161627700135822200&postID=906555059922090678&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://data-dump.blogspot.com/search/label/Java%2FJ2EE%20Programmer%20Practice%20Test%201%20%28page%202%29' rel='tag'>Java/J2EE Programmer Practice Test 1 (page 2)</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> </div> <div class='blog-pager' id='blog-pager'> <span id='blog-pager-newer-link'> <a class='blog-pager-newer-link' href='https://data-dump.blogspot.com/search?updated-max=2008-04-19T02:29:00-07:00&max-results=3&reverse-paginate=true' id='Blog1_blog-pager-newer-link' title='Newer Posts'>Newer Posts</a> </span> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' href='https://data-dump.blogspot.com/search?updated-max=2008-04-18T01:12:00-07:00&max-results=3' id='Blog1_blog-pager-older-link' title='Older Posts'>Older Posts</a> </span> <a class='home-link' href='https://data-dump.blogspot.com/'>Home</a> </div> <div class='clear'></div> <div class='blog-feeds'> <div class='feed-links'> Subscribe to: <a class='feed-link' href='https://data-dump.blogspot.com/feeds/posts/default' target='_blank' type='application/atom+xml'>Posts (Atom)</a> </div> </div> </div></div> </div> <div id='sidebar-wrapper'> <div class='sidebar section' id='sidebar'><div class='widget Image' data-version='1' id='Image1'> <h2>HDwallpapersnet</h2> <div class='widget-content'> <a href='http://www.hdwallpapersnet.blogspot.com'> <img alt='HDwallpapersnet' height='39' id='Image1_img' src='//1.bp.blogspot.com/_NS8la7vu-uE/SHzyIbj9tLI/AAAAAAAAAGI/VERP5UqkOPs/S220/hdwallpapers.png' width='220'/> </a> <br/> </div> <div class='clear'></div> </div><div class='widget HTML' data-version='1' id='HTML7'> <h2 class='title'>Vote</h2> <div class='widget-content'> <!-- Begin BlogToplist voting code --> <a href="http://www.blogtoplist.com/vote.php?u=40575" target="_blank"> <img border="0" alt="Top Blogs" src="https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vKe95TApGN6HivSBdrT90SbzJR8qorCiXhpDOH9rkjVZ2M-XKE_o_NRxsJGeDRSKMiZM_iVn9zYNJDeIUL2A4mXma_tmUflXfF-AlocX3F97sdiA=s0-d"></a> <!-- End BlogToplist voting code --> </div> <div class='clear'></div> </div><div class='widget HTML' data-version='1' id='HTML5'> <h2 class='title'>Track</h2> <div class='widget-content'> <!-- Begin BlogToplist tracker code --> <a href="http://www.blogtoplist.com/technology/" title="Technology"> <img border="0" alt="Technology" src="https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uv5z-ZanU_z8jD9MpfdQlZwDJHgA7uP0Q0o52Z1nXJRVy1dcYFN1rTu4Jen5ffkmP2CTeAs1z3euW9mamL65BteTrKQpTb2CLKgpVH4n8hu4g=s0-d"></a> <!-- End BlogToplist tracker code --> </div> <div class='clear'></div> </div><div class='widget AdSense' data-version='1' id='AdSense2'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-7946201296697281"; google_ad_host="pub-1556223355139109"; google_ad_host_channel="00000"; google_ad_width=120; google_ad_height=240; google_ad_format="120x240_as"; google_ad_type="text"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="2D8930"; google_color_url="3B8651"; google_color_text="666666"; //--></script> <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div><div class='widget HTML' data-version='1' id='HTML4'> <h2 class='title'>Technorati Favorite</h2> <div class='widget-content'> <a href="http://technorati.com/faves?sub=addfavbtn&add=http://data-dump.blogspot.com"><img alt="Add to Technorati Favorites" src="https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vs9OEUNHSpTXVK8VHv6AQhW0crRxS3LXa0Q5FS-SWcUiO05U4dLzHHbbPwcWq79CRD16x7KGQDjUnhLmANzyzCtHt2BYb4ykCigqTdutyq5_iBpLYpLg=s0-d"></a> </div> <div class='clear'></div> </div><div class='widget HTML' data-version='1' id='HTML2'> <h2 class='title'>Links</h2> <div class='widget-content'> <!-- Search Google --> <center> <form action="http://www.google.com/custom" target="_top" method="get"> <table bgcolor="#ffffff"> <tr><td nowrap="nowrap" valign="top" height="32" align="left"> <a href="//www.google.com/"> <img border="0" alt="Google" src="//www.google.com/logos/Logo_25wht.gif" align="middle"></a> <br/> <label for="sbi" style="display: none">Enter your search terms</label> <input maxlength="255" id="sbi" value="" name="q" size="31" type="text"/> </td></tr> <tr><td valign="top" align="left"> <label for="sbb" style="display: none">Submit search form</label> <input id="sbb" value="Search" name="sa" type="submit"/> <input value="pub-5665443526861688" name="client" type="hidden"/> <input value="1" name="forid" type="hidden"/> <input value="ISO-8859-1" name="ie" type="hidden"/> <input value="ISO-8859-1" name="oe" type="hidden"/> <input value="active" name="safe" type="hidden"/> <input value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1" name="cof" type="hidden"/> <input value="en" name="hl" type="hidden"/> </td></tr></table> </form> </center> <!-- Search Google --> </div> <div class='clear'></div> </div><div class='widget Label' data-version='1' id='Label2'> <h2>Labels</h2> <div class='widget-content list-label-widget-content'> <ul> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/3D%20Operations%20in%20DBMS'>3D Operations in DBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/3D%20Topology%20in%20Geo-DBMS'>3D Topology in Geo-DBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/A%20simple%20thread'>A simple thread</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Advanced%20Data%20Protection%20in%20Windows'>Advanced Data Protection in Windows</a> <span dir='ltr'>(4)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Applet'>Applet</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/ASP%20Tutorial'>ASP Tutorial</a> <span dir='ltr'>(5)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Basic%20Hardware%20Components'>Basic Hardware Components</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Basic%20HTML%20Tags'>Basic HTML Tags</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Computer%20Networks'>Computer Networks</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/computers'>computers</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Computers%20Basics'>Computers Basics</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5B%20PAGE%201%5D'>Core Java Programs [ PAGE 1]</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5B%20PAGE%202%5D'>Core Java Programs [ PAGE 2]</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5BPAGE%203%5D'>Core Java Programs [PAGE 3]</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/CSS'>CSS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/DBMS'>DBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Definitions'>Definitions</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Differences%20Between%20VBScript%20and%20JavaScript'>Differences Between VBScript and JavaScript</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Disadvantages%20of%20Computer'>Disadvantages of Computer</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/DISTRIBUTED%20DATABSE%20MANAGEMENT%20SYSTEM'>DISTRIBUTED DATABSE MANAGEMENT SYSTEM</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Efficient%20computer%20tools%3A%20what%20would%20you%20put%20on%20the%20list%3F'>Efficient computer tools: what would you put on the list?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Geo-DBMS%20Development'>Geo-DBMS Development</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/History'>History</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/How%20Java%20UsesThreads'>How Java UsesThreads</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/How%20to%20Use%20Computer%20Management%20on%20the%20Local%20Computer'>How to Use Computer Management on the Local Computer</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/HTML%20Attributes'>HTML Attributes</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/HTML%20Character%20Entities'>HTML Character Entities</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/HTML%20Elements'>HTML Elements</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/HTML%20Summary'>HTML Summary</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Introduction%20to%20Java%20Programming'>Introduction to Java Programming</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Introduction%20to%20Network%20Types'>Introduction to Network Types</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Introduction%20to%20PHP'>Introduction to PHP</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Introduction%20To%20XHTML'>Introduction To XHTML</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%20applet'>Java applet</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%20criticism'>Java criticism</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JAVA%20Date%20Utility'>JAVA Date Utility</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%20Interview%20Questions'>Java Interview Questions</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%20Runtime%20Environment'>Java Runtime Environment</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JAVA%20String%20Utility'>JAVA String Utility</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%2FJ2EE%20Programmer%20Practice%20Test%201%20%28page%202%29'>Java/J2EE Programmer Practice Test 1 (page 2)</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JavaServer%20Pages'>JavaServer Pages</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JDBC%20Programming'>JDBC Programming</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JDBC%20Programming%20Examples'>JDBC Programming Examples</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Learn%20HTML'>Learn HTML</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Logical%20view%20and%20physical%20view%20of%20DBMS'>Logical view and physical view of DBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Network%20Centrics'>Network Centrics</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/New%20Computer%20Inventions'>New Computer Inventions</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20Installation'>PHP Installation</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20String'>PHP String</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20Syntax'>PHP Syntax</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20Tutorial'>PHP Tutorial</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20Variables'>PHP Variables</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/RDBMS'>RDBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Relational%20Database'>Relational Database</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/SEO'>SEO</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Servlet'>Servlet</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Synchronization%3A%20the%20problem.%20part%201'>Synchronization: the problem. part 1</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Teletraffic%20engineering%20in%20broadband%20networks'>Teletraffic engineering in broadband networks</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Ten%20Common%20Database%20Design%20Mistakes'>Ten Common Database Design Mistakes</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/The%20Head%20Element'>The Head Element</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/The%20Thread%20Classes'>The Thread Classes</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Threads%20vs.%20Processes'>Threads vs. Processes</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Tips'>Tips</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Top%205%20Ways%20To%20Make%20A%20Computer%20Run%20Faster'>Top 5 Ways To Make A Computer Run Faster</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/What%20Are%20Software%20Engineering%20Metrics%3F'>What Are Software Engineering Metrics?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/What%20is%20a%20Thread%3F'>What is a Thread?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/What%20is%20the%20most%20efficient%20way%20to%20find%20information%20about%20computer%20security%3F'>What is the most efficient way to find information about computer security?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Why%20use%20HTML%204.0%3F'>Why use HTML 4.0?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/XHTML%20-%20Why%3F'>XHTML - Why?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/XHTML%20Exam'>XHTML Exam</a> <span dir='ltr'>(1)</span> </li> </ul> <div class='clear'></div> </div> </div><div class='widget AdSense' data-version='1' id='AdSense1'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-7946201296697281"; google_ad_host="pub-1556223355139109"; google_ad_host_channel="00000"; google_ad_width=120; google_ad_height=600; google_ad_format="120x600_as"; google_ad_type="text"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="2D8930"; google_color_url="3B8651"; google_color_text="666666"; //--></script> <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div><div class='widget HTML' data-version='1' id='HTML8'> <h2 class='title'>Top Tags</h2> <div class='widget-content'> <script charset="UTF-8" src="//widgets.technorati.com/t.js" type="text/javascript"></script> <div class="tr_embed_t_js"> <a href="http://technorati.com/blogs/data-dump.blogspot.com?sub=tr_embed_t_js" class="tr_embed_arg_blog">Blog Information</a> <a href="http://technorati.com/profile/ravinderravi?sub=tr_embed_t_js" class="tr_embed_arg_username">Profile for ravinderravi</a> </div> </div> <div class='clear'></div> </div><div class='widget HTML' data-version='1' id='HTML3'> <h2 class='title'>Map</h2> <div class='widget-content'> <script src="//feedjit.com/map/?bc=ffffff&tc=494949&brd1=336699&lnk=494949&hc=336699&dot=ff0000" type="text/javascript"></script><noscript><a href="http://feedjit.com/">Feedjit Live Blog Stats</a></noscript> </div> <div class='clear'></div> </div><div class='widget Profile' data-version='1' id='Profile1'> <h2>About Me</h2> <div class='widget-content'> <dl class='profile-datablock'> <dt class='profile-data'> <a class='profile-name-link g-profile' href='https://www.blogger.com/profile/12309791003951377157' rel='author' style='background-image: url(//www.blogger.com/img/logo-16.png);'> RAVI CHOPRA </a> </dt> <dd class='profile-data'>United States</dd> </dl> <a class='profile-link' href='https://www.blogger.com/profile/12309791003951377157' rel='author'>View my complete profile</a> <div class='clear'></div> </div> </div><div class='widget BlogArchive' data-version='1' id='BlogArchive1'> <h2>Blog Archive</h2> <div class='widget-content'> <div id='ArchiveList'> <div id='BlogArchive1_ArchiveList'> <ul class='flat'> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_07_15_archive.html'>Jul 15</a> (1) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_05_07_archive.html'>May 07</a> (12) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_04_25_archive.html'>Apr 25</a> (16) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_04_21_archive.html'>Apr 21</a> (3) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_04_19_archive.html'>Apr 19</a> (6) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_04_18_archive.html'>Apr 18</a> (28) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_04_17_archive.html'>Apr 17</a> (1) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_04_16_archive.html'>Apr 16</a> (2) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_04_15_archive.html'>Apr 15</a> (2) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_04_13_archive.html'>Apr 13</a> (4) </li> <li class='archivedate'> <a href='https://data-dump.blogspot.com/2008_02_29_archive.html'>Feb 29</a> (2) </li> </ul> </div> </div> <div class='clear'></div> </div> </div><div class='widget Label' data-version='1' id='Label1'> <h2>Ads</h2> <div class='widget-content list-label-widget-content'> <ul> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/3D%20Operations%20in%20DBMS'>3D Operations in DBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/3D%20Topology%20in%20Geo-DBMS'>3D Topology in Geo-DBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/A%20simple%20thread'>A simple thread</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Advanced%20Data%20Protection%20in%20Windows'>Advanced Data Protection in Windows</a> <span dir='ltr'>(4)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Applet'>Applet</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/ASP%20Tutorial'>ASP Tutorial</a> <span dir='ltr'>(5)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Basic%20Hardware%20Components'>Basic Hardware Components</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Basic%20HTML%20Tags'>Basic HTML Tags</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Computer%20Networks'>Computer Networks</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/computers'>computers</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Computers%20Basics'>Computers Basics</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5B%20PAGE%201%5D'>Core Java Programs [ PAGE 1]</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5B%20PAGE%202%5D'>Core Java Programs [ PAGE 2]</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Core%20Java%20Programs%20%5BPAGE%203%5D'>Core Java Programs [PAGE 3]</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/CSS'>CSS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/DBMS'>DBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Definitions'>Definitions</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Differences%20Between%20VBScript%20and%20JavaScript'>Differences Between VBScript and JavaScript</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Disadvantages%20of%20Computer'>Disadvantages of Computer</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/DISTRIBUTED%20DATABSE%20MANAGEMENT%20SYSTEM'>DISTRIBUTED DATABSE MANAGEMENT SYSTEM</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Efficient%20computer%20tools%3A%20what%20would%20you%20put%20on%20the%20list%3F'>Efficient computer tools: what would you put on the list?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Geo-DBMS%20Development'>Geo-DBMS Development</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/History'>History</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/How%20Java%20UsesThreads'>How Java UsesThreads</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/How%20to%20Use%20Computer%20Management%20on%20the%20Local%20Computer'>How to Use Computer Management on the Local Computer</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/HTML%20Attributes'>HTML Attributes</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/HTML%20Character%20Entities'>HTML Character Entities</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/HTML%20Elements'>HTML Elements</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/HTML%20Summary'>HTML Summary</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Introduction%20to%20Java%20Programming'>Introduction to Java Programming</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Introduction%20to%20Network%20Types'>Introduction to Network Types</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Introduction%20to%20PHP'>Introduction to PHP</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Introduction%20To%20XHTML'>Introduction To XHTML</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%20applet'>Java applet</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%20criticism'>Java criticism</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JAVA%20Date%20Utility'>JAVA Date Utility</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%20Interview%20Questions'>Java Interview Questions</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%20Runtime%20Environment'>Java Runtime Environment</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JAVA%20String%20Utility'>JAVA String Utility</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Java%2FJ2EE%20Programmer%20Practice%20Test%201%20%28page%202%29'>Java/J2EE Programmer Practice Test 1 (page 2)</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JavaServer%20Pages'>JavaServer Pages</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JDBC%20Programming'>JDBC Programming</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/JDBC%20Programming%20Examples'>JDBC Programming Examples</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Learn%20HTML'>Learn HTML</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Logical%20view%20and%20physical%20view%20of%20DBMS'>Logical view and physical view of DBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Network%20Centrics'>Network Centrics</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/New%20Computer%20Inventions'>New Computer Inventions</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20Installation'>PHP Installation</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20String'>PHP String</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20Syntax'>PHP Syntax</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20Tutorial'>PHP Tutorial</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/PHP%20Variables'>PHP Variables</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/RDBMS'>RDBMS</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Relational%20Database'>Relational Database</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/SEO'>SEO</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Servlet'>Servlet</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Synchronization%3A%20the%20problem.%20part%201'>Synchronization: the problem. part 1</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Teletraffic%20engineering%20in%20broadband%20networks'>Teletraffic engineering in broadband networks</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Ten%20Common%20Database%20Design%20Mistakes'>Ten Common Database Design Mistakes</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/The%20Head%20Element'>The Head Element</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/The%20Thread%20Classes'>The Thread Classes</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Threads%20vs.%20Processes'>Threads vs. Processes</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Tips'>Tips</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Top%205%20Ways%20To%20Make%20A%20Computer%20Run%20Faster'>Top 5 Ways To Make A Computer Run Faster</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/What%20Are%20Software%20Engineering%20Metrics%3F'>What Are Software Engineering Metrics?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/What%20is%20a%20Thread%3F'>What is a Thread?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/What%20is%20the%20most%20efficient%20way%20to%20find%20information%20about%20computer%20security%3F'>What is the most efficient way to find information about computer security?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/Why%20use%20HTML%204.0%3F'>Why use HTML 4.0?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/XHTML%20-%20Why%3F'>XHTML - Why?</a> <span dir='ltr'>(1)</span> </li> <li> <a dir='ltr' href='https://data-dump.blogspot.com/search/label/XHTML%20Exam'>XHTML Exam</a> <span dir='ltr'>(1)</span> </li> </ul> <div class='clear'></div> </div> </div><div class='widget HTML' data-version='1' id='HTML6'> <h2 class='title'>FEEDJIT Live Traffic Feed</h2> <div class='widget-content'> <script src="//feedjit.com/serve/?bc=ffffff&tc=494949&brd1=336699&lnk=494949&hc=336699&ww=160" type="text/javascript"></script><noscript><a href="http://feedjit.com/">Feedjit Live Blog Stats</a></noscript> </div> <div class='clear'></div> </div></div> </div> <!-- spacer for skins that want sidebar and main to be the same height--> <div class='clear'> </div> </div> <!-- end content-wrapper --> <div id='footer-wrapper'> <div class='footer section' id='footer'><div class='widget AdSense' data-version='1' id='AdSense3'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-7946201296697281"; google_ad_host="pub-1556223355139109"; google_ad_host_channel="00000"; google_ad_width=468; google_ad_height=60; google_ad_format="468x60_as"; google_ad_type="text"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="2D8930"; google_color_url="3B8651"; google_color_text="999999"; //--></script> <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div><div class='widget HTML' data-version='1' id='HTML9'> <h2 class='title'>Page Rank</h2> <div class='widget-content'> <a href="http://www.populararticles.com/tools/"><img border="0" src="https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vzpzOHbwOUYJtO0-A-vr4_90afTu9hnsqqu94mODMJQYIfqFlks0i4BYiv4ZZwB50DUtX2PrxubSkM1MT0P_jRVdIZUvdS82ZRoRXtTvkMU0kjjXlMEERiriIhIP1dbs208GjDm_XeBsCJGbuy8DxvtKE1upgJh5wi=s0-d"></a> </div> <div class='clear'></div> </div></div> </div> </div></div> <!-- end outer-wrapper --> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/1807328581-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'AOuZoY5Zl0bwcej5uTJSpXp5tx2aIYkUUA:1714236285907';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d161627700135822200','//data-dump.blogspot.com/2008_04_18_archive.html','161627700135822200'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '161627700135822200', 'title': 'DATA DUMP', 'url': 'https://data-dump.blogspot.com/2008_04_18_archive.html', 'canonicalUrl': 'http://data-dump.blogspot.com/2008_04_18_archive.html', 'homepageUrl': 'https://data-dump.blogspot.com/', 'searchUrl': 'https://data-dump.blogspot.com/search', 'canonicalHomepageUrl': 'http://data-dump.blogspot.com/', 'blogspotFaviconUrl': 'https://data-dump.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'en-US', 'localeUnderscoreDelimited': 'en', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': false, 'isMobileRequest': false, 'mobileClass': '', 'isPrivateBlog': false, 'isDynamicViewsAvailable': true, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22DATA DUMP - Atom\x22 href\x3d\x22https://data-dump.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22DATA DUMP - RSS\x22 href\x3d\x22https://data-dump.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22DATA DUMP - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/161627700135822200/posts/default\x22 /\x3e\n', 'meTag': '', 'adsenseClientId': 'ca-pub-7946201296697281', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': true, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/16e657cb9c57b8a2', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': 'Get link', 'key': 'link', 'shareMessage': 'Get link', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': 'Share to Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'Twitter', 'key': 'twitter', 'shareMessage': 'Share to Twitter', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': 'Share to Pinterest', 'target': 'pinterest'}, {'name': 'Email', 'key': 'email', 'shareMessage': 'Email', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27en\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': 'Read more', 'pageType': 'archive', 'pageName': '04/18/08', 'pageTitle': 'DATA DUMP: 04/18/08'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Link copied to clipboard!', 'ok': 'Ok', 'postLink': 'Post Link'}}, {'name': 'template', 'data': {'name': 'custom', 'localizedName': 'Custom', 'isResponsive': false, 'isAlternateRendering': false, 'isCustom': true}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': false, 'title': 'DATA DUMP', 'description': 'This DataDump site provide you Everything about computer , computer science ,computer programming , like java ,C++\x26 C \nalso Dbms related Data provide it.\nsome additional data like windows , and other.\nyou got here lots of data that you can never', 'url': 'https://data-dump.blogspot.com/2008_04_18_archive.html', 'type': 'feed', 'isSingleItem': false, 'isMultipleItems': true, 'isError': false, 'isPage': false, 'isPost': false, 'isHomepage': false, 'isArchive': true, 'isLabelSearch': false, 'archive': {'year': 2008, 'month': 4, 'day': 18, 'rangeMessage': 'Showing posts from April 18, 2008'}}}]); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/1666805145-lbx.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/13464135-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_ImageView', new _WidgetInfo('Image1', 'sidebar', document.getElementById('Image1'), {'resize': false}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML7', 'sidebar', document.getElementById('HTML7'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML5', 'sidebar', document.getElementById('HTML5'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense2', 'sidebar', document.getElementById('AdSense2'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML4', 'sidebar', document.getElementById('HTML4'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML2', 'sidebar', document.getElementById('HTML2'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_LabelView', new _WidgetInfo('Label2', 'sidebar', document.getElementById('Label2'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense1', 'sidebar', document.getElementById('AdSense1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML8', 'sidebar', document.getElementById('HTML8'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML3', 'sidebar', document.getElementById('HTML3'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_ProfileView', new _WidgetInfo('Profile1', 'sidebar', document.getElementById('Profile1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogArchiveView', new _WidgetInfo('BlogArchive1', 'sidebar', document.getElementById('BlogArchive1'), {'languageDirection': 'ltr', 'loadingMessage': 'Loading\x26hellip;'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_LabelView', new _WidgetInfo('Label1', 'sidebar', document.getElementById('Label1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML6', 'sidebar', document.getElementById('HTML6'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense3', 'footer', document.getElementById('AdSense3'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML9', 'footer', document.getElementById('HTML9'), {}, 'displayModeFull')); </script> </body> </html>