Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners debugging techniques

Have Programming Question? Ask it here!
 
 
 


umbrella.abc
debugging techniques
1 Answer(s)      2 years and a month ago
Posted in : Java Beginners


java program to accept the employee code from user and validate it according to the following logic. The first character of the employee code should be the letter 'E'. If it is any other letter, throw a user defined exception that displays an appropriate error message.


Advertisement
View Answers

June 15, 2012 at 5:15 PM


Here is an example that validates employee code. The given code accepts the code from the user and validate using regular expression. If the user starts the code with the capital letter E followed by other alphabets and numbers, then it will take otherwise it will show error message and allow the user to enter again.

import java.util.*;
class ValidateEmployee 
{
    public static boolean validateString(String st) {
                return st.matches("[E]+[a-zA-Z0-9]*");
        }



    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.print("Enter code: ");
        String code=input.next();
        while (validateString(code) != true) {
                        System.out.print("Invalid String!");
                        System.out.println();
                        System.out.print("Enter String: ");
                        code = input.nextLine();
                }
    }
}


Related Tutorials/Questions & Answers:
debugging techniques
debugging techniques  java program to accept the employee code from user and validate it according to the following logic. The first character of the employee code should be the letter 'E'. If it is any other letter, throw a user
debugging javascript - Java Beginners
debugging javascript  hi all, can anybody tell me which is the best way to debug javascript?  Hi Friend, Use IE8 beta. It is very powerful and works well. Thanks
Advertisements
search and sort techniques in java
search and sort techniques in java  Hi i attened an interview recently... they asked to write all searching and sorting technique codes in java.. i said i would use collection frame work for it.. but they dosnt want me to use
Debugging in jsp? - JSP-Interview Questions
Debugging in jsp?  Hi Friends, am newbie to jsp.How to debug error in jsp
Java: Debugging Output
Java: Debugging Output System.out.println The System.out.println is used to debug a java program. Here is one example code: class HelloWorld { public static void main(String[] args) { System.out.println("Hello
start debugging problems related to the JDBC API
start debugging problems related to the JDBC API  How do I start debugging problems related to the JDBC API
RIAs Methods And Techniques
RIAs Methods And Techniques JavaScript It is the first major client side language technology that has the ability to run code and installed on several major of web clients. Earlier its uses were relatively limited but the development
a competitive study on cryptography techniques over block cipher
a competitive study on cryptography techniques over block cipher  i need "a competitive study on cryptography techniques over block cipher" project source code... plz reply to my post... for more information about this project
Business Analysis Techniques
There are many business analysis techniques that are quite useful in carrying out an effective and productive business analysis. Some of the important techniques for business analysis often used by business analysts are: PESTLE
[Mini-Project] Develop a programmer's editor in Java that supports syntax highlighting, compilation support, debugging support, etc.
[Mini-Project] Develop a programmer's editor in Java that supports syntax highlighting, compilation support, debugging support, etc.  Please reply me sir
Techniques used for Generating Dynamic Content Using Java Servlets.
Techniques used for Generating Dynamic Content Common Gateway Interface (CGI) For any web application high performance and timely delivery are key ingredients to competitive success.Earlier
Top 20 SEO Techniques for Google Search Ranks
, some of the good old SEO techniques have never been so important. Once again.... Though in presenting top SEO techniques for Google search ranks we are most likely... tools and techniques. Here is our pick on top SEO techniques for Google search
Web 2.0 Characteristics,Web 2.0 Applications,Web 2.0 Conference,Web 2.0 Tools,Web 2.0 Technologies,Web 2.0 Techniques
usually feature a number of following techniques: Rich Internet application techniques, optionally Ajaxbased Cascading Style Sheet, CSS Semantically valid
Techniques to Improve GPS Accuracy
Techniques to Improve GPS Accuracy       Introduction GPS is the best navigation and tracking... resolution techniques, the entire processing work done in real time. New
RIAs Methods And Techniques
RIAs Methods And Techniques       JavaScript It is the first major client side language technology that has the ability to run code and installed on several major of web
Search Engine Optimization (SEO) Techniques
Search Engine Optimization (SEO) Techniques Search engine optimization... include techniques which are recommended as good design techniques. While black hat techniques are those techniques which are not approved by search
FLABot
of the existing techniques to deal with debugging operate at the level of source code...; FLABot is a fault-localization and debugging tool for Eclipse plug-ins, which...) and supported by Intel Corporation. Project Description Debugging is one of the most
DDchange
DDchange       DDchange is an Debugging Framework that automatically determines why your program fails. Find out which change causes your program to fail: DDchange
Method
Method       In this section, we will explore the concept of method in the reference of object oriented programming techniques. As we earlier described in the topic class, a class have
Method in Java
Method in Java       In this section, we will explore the concept of method in the reference of object oriented programming techniques. As we earlier described in the topic class
Illatis StepIn - Debugger for MySQL procedures
, Eclipse based IDE that makes debugging MySQL stored procedures and functions... Debugging With StepIn section. It will guide you through the steps and you
Ensemble Glider for Eclipse
Ensemble Glider for Eclipse       An Eclipse plugin for rapid J2EE application development and debugging. Create and test EJBs and JSPs without
SmartInspect
logging tool for debugging and monitoring your projects and applications... SmartInspect is the perfect solution for debugging web applications, distributed
PHP Generate a pages loading time Tutorial
PHP Page Loading Time       In the given example we will learn how to generate and display the amount of time taken to load and display a specific page, for debugging or display
Printing a Stack Trace to the Server Console
the error instead of debugging jsp pages. By  the stack trace, you will know... getMessage() method of the exception to print errors during debugging process
ILOG Business Rule Studio
-editing and debugging of Java code and rules. Rule Studio supports deploying and debugging rulesets to Rule Execution Server and enables collaboration
Multicast in Java
Multicast in Java       Multicast in Java This section introduces you how to deliver or transmit data in network and describes the fundamental of various techniques like
Class
techniques. A class defines the properties of  objects and methods used... concept is employed in the object oriented techniques to create the objects through
Log4Fx
Log4Fx        Log4Fx component facilitates logging and debugging of your Flex application by letting you set up the logging on the client or server sides as well
How to Add Array Item in PHP
i)    PHP array add item In this PHP tutorial we will discuss about the different techniques to add item into an array.  array_push() is one of the widely used function to add item into an array.General format
JS-Sorcerer: JavaScript Development Tool
or Ajax application, and less time testing and debugging it. Read about its
Altova XMLSpy
and XML development environment for modeling, editing, debugging, and transforming... need a tool for creating, editing, and debugging XML-related technologies
TinyOS Plugin for Eclipse
, help, debugging facilities and enhanced search functionality. This plugin aims
Google Penguin Algorithm update issues and How to Recover
and Grey-Hat SEO techniques have been hit harshly. SEO must make sure... website. SEO used paid links techniques to target specific keywords, generate
How to Protect against the Penguin Update
techniques and NOT Black-Hat or Grey-Hat SEO techniques. It has been proven time
How to Recover from Google Penguin Update and Get the Ranking Back
Just after May 22 2013, all websites involved in Black-Hat and Grey-Hat SEO techniques took a huge dive in their ranking. Poorly indexed websites, spammy... reason. They were targeting search engine and planned their SEO techniques around
Google Penguin 2.0 Update
cashing on Black-Hat SEO techniques and SEO tricks but Google is day-by-day... SEO techniques. 2.3% of English searches have been affected by this update
Cell Phone Locator System
of techniques that let a party or a person to know about the location coordinates... at the location of the nearby cell phone. The accuracy mobile tracking techniques... techniques. The technologically advanced system of tracking the Phone only
iPhone Application Store Submission and Acceptance Process
Development, App Testing and Debugging, Application Listing on the online Apple iPhone
SubText Plugin
, monitoring and logging, debugging support, multi-object protocols, etc
PHP Variable Across Pages
PHP variables across pages When we develop web applications, sometimes we need to share values among various web pages. PHP provides various techniques to do so, there are many pre-defined variables are used to pass values from
How to Recover from Google Penguin 2.0 Updates
SEO and Grey-Hat SEO techniques, all have taken a big blow after the launch... for a long term White-Hat SEO techniques are the only way. At first "no follow" all.... But with the release of Penguin 2.0 , Google is making sure that such techniques does
Pros and Cons of Gray Hat SEO
. According to the acceptance level and ethical shortcoming of techniques geared towards search engine results there are three distinct types of SEO techniques, respectively as Black Hat SEO, Gray Hat SEO and White Hat SEO techniques
Linux Books
compiler options for optimization and debugging. This book does not attempt
Software Development Process Models
that includes various tools and techniques, knowledge and efforts to execute
Project Cost Management
and productivity of the project with the help of various tools and techniques. Project.... Tools and Techniques for Resource Planning Expert judgment: Expert judgment... and hence can be useful. Tools and Techniques for Cost Estimating Analogous
JSlice
JSlice What is dynamic slicing? Dynamic slicing is a technique for program debugging and understanding. Given a program P, the programmer provides a slicing criterion of the form (I, L, V), where I is a program input, L
Advertisements
 

 

 

DMCA.com