Friday, August 10, 2012
Friday, April 6, 2012
Object initialization is very important in programming, as it is a common source of bugs. The Java Programming language provides different built-in mechanisms to ensure proper initialization of the memory occupied by a newly-created object, there by helping the objects to get a valid initial state.
The Java Programming language offers three mechanisms to ensure proper initialization of newly created objects.
* Instance variable initialization.
* Instance initialization.
When we are creating an object using new operator or the new Instance() method of class, JVM allocates memory for it, then Java virtual machine will run the initialization code before we use the newly-allocated memory.
Constructors are methods, with a set of parameters and a body of code and has the same name as the class but has no return type. The constructors can be overloaded by varying the number, types, and order of parameters. When we are creating new instance using new keyword we often provide a constructor that initialize the Object. If we are using class that has no constructor defined, the compiler will automatically generate a default constructor for the class. This constructor has no parameter and has empty body, this ensures that each class has at least one constructor.
// the initialization code for instance variables
Instance variable initialization
In an instance variable initialization method java uses an equals sign and expression technique to initialize the instance variable.
private int a = 1; //this evaluate a with a value of 1
Instance initialization is also known as instance initialization block, which is one of the alternatives to Instance variable initialization. It is very useful in following situations
* Initializer code need to catch exceptions.
* Initializer code need to do calculations that can't be expressed with an instance variable initializer.
* If class has multiple constructors - no need to repeat the same initializing code in all constructors.
* When we use anonymous inner classes, which normally do not have constructors.
private int a;
One of the main properties of initializers is they cant make forward reference, as the initializers are executed in textual order.You have to make sure that the referring of instance variable should be only after it is initialized.
Default initial values
If we are not providing any explicit initialization method to variables including instance and class variables, they will be initialized according to their type. Each data type has its own default initial values. The local variable must be initialized explicitly before use.
int - 0
Java's initialization mechanisms help the programmer to ensure that objects we design have a valid and predictable state.
Article Source: http://EzineArticles.com/4564513
Sapient : Work-from-home is the HR trend that seems to have evolved from IT & ITES firms who mainly leverage on Internet to connect & collaborate with business associates, partners and clients.
The new beginners section "New to Java technology" on Roseindia.net, can help the dummies to learn java from basic to masters level.
This new to java tutorial briefs you on following topics.
1. Basics of Java Technology
2. Understanding the Java Technology
3. Why Java Technology is so important?
4. Different Editions of Java Technology
5. Components of each edition
· JSE Components:
· JEE - Components: etc... etc...
How to create and run my first java program, to what extension java file should be saved, java compiler, java and jdbc database connectivity or java with database management system. These are the very common problems raised while learning java.
Here in this new to java section you will find all the required solution to step ahead on next level of java technology.
The Additional features "Java Examples" of New to java tutorial can help you in learning java quickly and easily. As example codes are already written, you only have to copy and paste it to execute and run the program. In this way you can save yourself from writing code and fixing the bugs.
Find out more about java tutorials, struts tutorials and other programming language at Rroseindia.
Take a quick glance of what you can learn here ...
1. Java tutorials: Basic and advance Java to enhance your skills.
2. JSP Tutorials: Java server pages and other scripting language.
3. Spring and Hibernate Tutorials
4. MySql tutorials: Database connectivity by using java and MySql
That's not all, here you will find numerous tutorials on latest programming technology along with running examples and descriptions.
This review new to java has written for the java beginners, at roseindia.net you can read more New to java tutorial, struts tutorial for beginners and professionals to enhance your skills.
Article Source: http://EzineArticles.com/562728
The last few years, multicore processors have become less expensive. Most desktop computers and laptops are using multicore chips and developers are programming more and more with multiple concurrent threads. A downside is that the bug reports related to threading are also increasing every day; this shows that multicore programming is not the easiest thing to do. In Java, concurrency bugs are one of the most painful problems and in many occasions they are highly unpredictable. One of the biggest issues regarding Java concurrent programming is the mind-set of the programmers that doesn't match the concurrency features offered in Java. Programmers need to start thinking about concurrency and parallelism in the foundation of their programs. The Java language provides low level tools for concurrency such as condition waits, synchronization, message passing and resource sharing. The problem is that these tools need to be implemented at application level consistently. The conclusion? It can already be hard to write correct programs, but writing correct concurrent programs is even harder. The right mind-set is needed. The reason behind the high difficulty level is that there are simply more levels where things can go wrong with Java concurrent programming. The reason developers still choose to use concurrency on their programs is because threads are an inevitable feature of the Java language and the easiest way to use the multicore power we see almost everywhere these days. When looking are the future, the only conclusion that can be made is that concurrency programming will become increasingly important with the rising number of cores.
For more information regarding Java concurrent programming, please visit www.ateji.com.
Article Source: http://EzineArticles.com/6401289
Monday, February 6, 2012
This article is about a small simple collection of batch files which can be used to test the behavior of the javac compiler and java class launcher for different classpath scenarios. The system is called ClasspathTester. Download instructions are included at the end of this article.
When you are in the middle of trying to debug a java build it is a bad time to try to boil everything down to a simple test case, so basically the intent of my test collection is to do this for you ahead of time. If you can't find the precise test you need, it is easy to modify the existing tests or create a new test to suit your needs.
How ClasspathTester Works
As previously stated, I did everything with batch files, because I wanted the tests to be as uncomplicated, portable (within the Windows environment), and simple as possible. There are a few helper batch files to do things like create formatted output and build a directory structure, but otherwise nearly all of the work is done in the RunAllTests.bat file.
What RunAllTests.bat consists of is tests and sub-tests. If you haven't downloaded it yet, I suggest you download it and take a look. Each test consists of some sort of a setup. Setup normally involves the following:
1. Test environment is cleaned up of old directories, files, and classpath.
2. New directory structure is created, new files are created and placed in correct directories, and the classpath is set if necessary.
After setup, the tests are run. This consists of running either the javac.exe compiler, the java.exe launcher, or both. That's all there is to it.
A Simple Example
To understand what ClasspathTester, does, open the RunAllTests.bat file in your text editor and look at TEST1. Each test is a collection of sub-tests which are loosely grouped around some kind of a central testing theme, and TEST1 is one of the simplest.
So what happens in Test1? First it calls banner.bat to add a header to the results file. Then it creates the Hello.java and MyLibClass.java files, by copying them from their corresponding avaj files (the reason for using avaj files is discussed later in this article). Now everything is set up to run some subtests.
TEST1A is very simple. According to its description, " The Hello.java file is located in the current directory, and the Hello.class file will be written to the current directory and run from the current directory". As you can imagine, TEST1A operates flawlessly.
TEST1B and TEST1C are designed to show different ways that using java.exe to launch the Hello.class file can fail. In TEST1B the classpath is been set to an empty directory. In TEST1C the file Hello.class is erased. Interestingly, these two tests fail in exactly the same way.
Note that all tests results are stored in the results.log file.
How the Tests are Kept Safe
By "safe" I mean safe to your computer, safe to your other data. Since the tests involve batch files that are creating and destroying files and directories, care must be taken to avoid accidentally destroying or writing over other unrelated files. This is accomplished in the cleanup.bat file by avoiding the use of statements like "erase /S *.*" or "rmdir /S *". Instead, all erasures are kept fairly specific.
In fact, the cleanup.bat file consists of the following statements:
rmdir /S /Q aq
rmdir /S /Q EmptyDirectory
This ensures that there will be no tragic accidental loss of unrelated data.
Why Use .avaj Suffix Files
Part of the operation of ClasspathTester involves completely wiping the base directory clean of all .java files, .class files, and subdirectories; therefore, all the suffix of all permanent java files is mangled to avaj. For any test, the appropriate avaj files are copied to java files. The available files are:
You can find and download a zipped copy of the ClasspathTester can be on my Article Support Page
ClasspathTester is simple, portable, unobtrusive, customizable and solves an annoying development problem, the need to quickly test special classpath situations with javac.exe, java.exe, or both.
Monday, January 23, 2012
Java is an enterprise Language, what it means it is used to build enterprise applications, what do we mean by that?
· A variety of clients can interact with applications like browsers, smart tablets, B2B applications, .NET and other language apps.
· High Security to support the standards.
· Highly Scalable to support the growing traffic.
· Performance - Begin compile time performance is high.
· E.g applications are Gaming, ECommerce websites, Billing, Retail, CRM and tons of others
Java can be used to create blogging CMS like WordPress. There are CMS's like alfresco, Plone, JRoller whodo to attempt to that, but none has been able so popular as WordPress.
Very specialized CMS/blogging engine build on top of PHP.
· It is very easy to learn software, compare it to learning MS Word.
· You don't need to know PHP/programming to be WordPress website developer.
· It has a themes concept, which allows a developer to configure website pages with easy.
· Supports thousands of plugins, almost easy to find any kind of functionality a website needs.
· Installs on Apache Server with PHP engine.
· Many hosting sites support 1 click install.
· Uses MySQL as the backend engine.
As you see, WordPress and Java cannot be compared as one is a language where another is a software built on PHP language.
Had WordPress been written in Java
As a Java Developer, I do wish WordPress was built on Java, it would have given
1. Java applications a web flair, we would have to see all together new set of applications /widgets/ plugins.
2. Designers would have not been scared of the language at all.
3. Applications could have used the WordPress database, which has a very simple schema.
WordPress And Java Together
Resin is a Java Application server, but with a twist, it has a Quercus engine which allow PHP applications to installed as Java applications.
What does this mean, if a WordPress can be installed on Resin will run as a Java application and also take advantage of libraries like Spring, Hibernate,SOA.
Also, will definitely perform way better as it will be compiled only once and not be interpreted with every request like it does now
To have this integration working has its own challenges but good news is there is a way.
While WordPress has it own niche, creating CMS websites with blog functionality, it is the DeFacto Platform.
But when it comes to creating highly scalable enterprise Applications Java is the DeFacto Platform.
Makarand Bhatamrekar is a enterprise Java RIA Career Coach. He has been coaching since 2007 on Java technologies to help trainees achieve their java career goals. http://careerInJava.com is a dedicated the effort to give all the resources needed to succeed.
To be informed of the latest update, do subscribe the Newsletter at http://www.careerInJava.com
WordPress is the easiest CMS out here, which allows to create your website with no knowledge of PHP. Makarand was able to develop coaching website on WordPress with no prior knowledge of the same, hence this post comparing the two.
Article Source: http://EzineArticles.com/6811651
Wednesday, July 20, 2011
The importance of Java in the software scenario has led to another major trend. Software vendors are either rewriting their existing products in Java, or are creating new products exclusively or partially in Java. This has led many analysts to question the need to port already existing applications to Java. While the prospects of porting small or medium sized software to Java may not attract concern, it assumes significance when we consider porting existing databases that could be handling millions of sensitive blocks of information. Similarly, experts also have to decide between deploying reputed databases, and new databases that have been entirely developed in Java, in their organizations. Analysts have to answer many pertinent questions like: What are the advantages of a Java RDBMS that would compel my company to switch to it? Would it be cost effective to change to an RDBMS that has all the advantages of Java? Would the costs involved in porting millions of existing records justify the perceived performance and scalability features of the Java RDBMS? How secure would be the new RDBMS? What is the learning curve that has to be tackled by the staff who may be assigned to this database? In fact, there are a host of questions that a concerned technical head may ask himself before taking that all important decision to switch to a Java RDBMS. Let's try finding out some of the answers.
What are the advantages of a Java RDBMS?
OK, so we all know that Java is set to capture, or has already captured a sizeable chunk of the software market. However, how does that justify the use of a Java Database? After all, is not Java theoretically capable of integrating with any database? What advantages can be afforded by a Java RDBMS?
Well the answer is quite simple. Java RDBMS has, or supports, the much sought after qualities of Java, which is the most important reason to switch to it. Some of the Java RDBMS already available in the markets answers the immediate concerns of the Technical Lead in the most persuasive manner. For example, Daffodil DB, an RDBMS written in Java, considers the following as its core strengths:
Multiple Platform Portability
Java Stored Procedures
Transparent to End User
Zero Administration Efforts
Some of these features are worth a second look.
One RDBMS, multiple avatars
Java RDBMS not only offers the advantages of Java, but also introduces new concepts that can revolutionize database programming techniques. For a start, the much famed portability of Java is the core strength of a Java RDBMS. Now, you don't have to buy different RDBMS for different platforms within the same enterprise. Other than the cost factors, the biggest advantage such an arrangement can give is that in-house code need not be redesigned for different platforms. By standardizing the database that is used, programs working across platforms can interact transparently and effectively. Project managers would vouch that portability, synchronization and customization effort for software running on different platforms are some of the most time consuming and tension filled activities in the office. Now all these activities can be easily implemented with the Java RDBMS in its rightful place.
Store and use those procedures with abandon
Security buffs within the enterprise would always throw a tantrum when dealing with stored procedures. Traditionally, the implementation of stored procedures had been the responsibility of the specific application vendor, and most of them could crash the whole database due to internal errors, rendering precious time and money waste. Java stored procedures with its inbuilt security features is the new fad of security administrators who are finding it powerful, fast, and very safe. Java does not implement Pointers, and so is a safe bet for developers to write secure code and procedures. In addition, with the JVM overlooking all the activities (the sandbox approach), there is no scope for external access that could jeopardize mission critical enterprise applications.
Transparent to End User
Java technologies have always been in the forefront to give us seamless transparent applications with inbuilt security features being given the utmost importance. In a Java RDBMS, database components can be embedded in applications, and they can perform complex tasks without user intervention. In addition, the user need not know the complexities of the database because the embedded database components will do all the work for him without him even knowing about it. This allows the user to concentrate on his tasks rather than configuring databases, which is an auxiliary requirement. In addition, other routine activities like starting the server and repetitive configuring of the database can also be avoided. Perhaps the biggest advantage that Java RDBMS offers is that the user need not weigh the pros and cons about choosing a database vendor. This is because Java RDBMS being extremely portable can seamlessly integrate with almost all platforms, and the embedded components will handle all the chores of integrating with different vendor software. Java RDBMS can also be seamlessly operated across multiple platforms without the need to configure the database for each and every operating system.
Zero Administration Efforts
Java RDBMS comes in with zero administration efforts, which means that once installed and configured, your clients need not change their settings to suit new changes that you make in your database. Java RDBMS also does away with, or considerably reduces, the role of the Database Administrator because of its self-managed features, and its extremely scalable mode of operation.
If you have not thought of it yet, it is a good time to think about Java RDBMS. The time is not far away when the databases industry will be greatly influenced by the power and functionality of Java RDBMS.
Article Source: http://EzineArticles.com/3103
Diamond Engagement Ring : Womens & Mens Diamond Watches & Diamond Jewelry Sale up to 82% Off: Diamond watches, diamonds, womens and mens diamond jewelry at NYCs #1 Diamond Jewelry Store.
Buy Digital Cameras Online : Digital Cameras have simplified the process of taking high quality pictures. Today, practically all cameras are digital which allow maximum photo taking efficiency. These cameras have built-in computers and all of them record images electronically.
Swarovski 5810 : original Swarovski Crystallized TM Elements Made in Austria, swarovski 2028 xilion rose, rhinestones, swaroski, svaroski, strass, swarovski strass, swarovski stones
weight loss supplements : Want no more diets. Looking for fast weight loss pills or diet pills? We are the most trusted diet pill review site. Visit #1 ranked diet pill now!
K2 Trophies and Awards : Trophies & Trophy: Looking for lowest price trophies, awards, medals or plaques? Visit K2 Trophies and Awards. We have the right trophy, plaque or award for any sport or occasion. FAST FREE shipping on orders over $200. High quality but cheap price.
Self managed super Bankstown : We have experienced Small Business Company Accountants across Liverpool, Moorebank, Ingleburn, Campbelltown, Bankstown, Wetherill and Fairfield having in depth understanding of each industry’s areas of risk and opportunity.
Travertine floor tiles Travertine Marble Kitchen Tiles - Marble Kitchen Tiles and Travertine Kitchen Tiles at great prices from StoneSuperStore. Visit today or call for expert advice on Kitchen Tiles. masterbatchesREPIN is #1 Masterbatch Industry among various Masterbatch Manufacturers & supplier, providing services worldwide. Get Clariant Masterbatch and more from REPIN. welding projects TIG, MIG, STICK, Plasma Cutting, Welding Advice, Welding Forum, Tips, Tricks, Learn How To Weld for Professionals and Enthusiasts penny stocks Peter Leeds and his Team Use Leeds Analysis to Uncover the Absolute Best Penny Stock Picks and Top Penny Stock Picks. Visit Penny Stocks Now Wohl Associates At Wohl Associates We purchase an individual machine or a complete a line or even a complete facility, including real estate. Life Insurance Quote Lifebroker provides free life insurance & income protection quotes that allow you to compare 20 different life insurance companies in once place. We are the broker of choice across the United Kingdom for all your personal life, critical illness, disablement and income protection needs. fence panelsFence Stores is one of the Southâ€™s largest manufacturers and suppliers of Fencing, Fencing Panel, Fence Panels, Industrial Fencing and Garden Buildings such as Summerhouses, Sheds and Cabins serving Devon, Somerset, Hampshire and Dorset. Melbourne accommodation deals Melbourne accommodation deals, news and updates from City Edge accommodation Apartment and Hotels. We offer the best accommodation deals in Melbourne. Debbie Dogrul Associatesleading no VA real estate team in Virginia. The best Northern VA realtors to aid you in your Northern Virginia house for sale or purchase. Letting AgentLetting agents are individuals who deal with rental property on a landlord’s behalf in exchange for fees. They can provide a whole range of services depending on your requirements. Unlike many Lettings Agents there are no hidden fees when dealing Greenaway Residential Letting Agents and we only get paid when our clients get paid. Personal injury ProtectionLeading Law Firm & Attorney Brad Sinclair Represents Personal Injury, Car Accident & Motorcycle Accident Victims in Melbourne, Palm Bay, Cocoa Beach, Titusville, Rockledge, Merritt Island, Cape Canaveral, Cocoa and Brevard County. commercial plumber Wet Basement Repair Meet Wet Basement Waterproofing Expert can resolve home issue like Leaky Basement and many more. Visit www.dxbasementwaterproofing.com for Wet Basement Repair. window coverings new york marine paint protectionTRIBOS, the leading international supplier of protective paint coatings for the automotive, marine and aviation market has now gained a strong foothold in the Southeast Asia. Whistler Mountain Transportation Whistler Mountain Transportation specializes in providing luxurious, chauffeured transportation to Whistler Blackcomb from either Vancouver or Seattle. junk removal in San DiegoLooking for water heater removal in San Diego? We are a full-service water heater removal and hauling services based in San Diego. Call Junkeez for a free estimate today! hotels in Stellenbosch - Find the best accommodation in Stellenbosch and hotels in Stellenbosch with Majeka Guest House. Chicago limo serviceAny Time Limo Chicago Provide Top Quality Limo & Limousine Services in Chicago and Suburban Area at Reasonable Rates. To Book Limousine in Chicago Call Us (773) 353-8024) Or Visit Us! San Diego Advertising San Diego solar power will benefit home-owners who consume more electricity than average users. They pay high income taxes and they can benefit a lot from tax credits. San Diego Solar PanelThe Restaurants in San Diego are famous for serving the world’s best beer. The bars offer a glamorous as well as erotic atmosphere to their customers. charter bus service in San FranciscoWe provide charter bus service in San Francisco at affordable prices with complete client satisfaction. homes for sale in Santa Ana Search Luxury Homes for Sale in Orange County through homesalesinorangecounty.com. Our listing Updated daily with latest Listing on homes/houses for sale in Orange County. Contact us today! Vancouver airport limo serviceisGet special deal on booking of vancouver airport ground transportation to whistler with details of all cheap Vancouver Airport Limo Service by prime time limo services. washer dryer house lightingLED world is an online electrical wholesaler in Australia which offers led flood lights and led strip light at affordable prices. restaurant in Cape Town Whistler limousine service Limousine is considered as the most luxurious transportation among all and it is like a dream come true for anyone getting a chance to travel in it. Whether it is a wedding occasion or graduation prom or any corporate meeting, people expect to enjoy a luxurious ride and arrive in style. Time and Gems