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



Home Answers Viewqa Java-Beginners Use of assert keyword in Java

Have Programming Question? Ask it here!
 
 
 


Deepak Kumar
Use of assert keyword in Java
1 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners


Hi,

What is the purpose of assert keyword used in JDK?

Thanks

Advertisement
View Answers

October 5, 2010 at 4:45 PM


Hi Friend,

It is used to validate an expression. It is a keyword that is represented by a boolean expression and enables you to test your assumptions about your program. It evaluates to true, but if the expression is not true, the system will throw an error through an AssertionError.

For more information, visit the following link:

http://www.roseindia.net/javatutorials/use-assertion-in-java.shtml

Thanks


Related Tutorials/Questions & Answers:
Use of assert keyword in Java - Java Beginners
Use of assert keyword in Java  Hi, What is the purpose of assert keyword used in JDK? Thanks   Hi Friend, It is used to validate an expression. It is a keyword that is represented by a boolean expression
assert In Java
features that it have. To use assertion in Java there is a keyword named assert... testing. Use of assert keyword in Java improves the quality of code...assert In Java In this section we will discuss about the assert keyword
Advertisements
How to use this keyword in java
How to use "this" keyword in java       The keyword this is useful when you need to refer... use this keyword. Here, this section provides you an example with the complete
Assert in Java
In this section we will discuss about what is assertion, how to use assert keyword and benefits of assertion in Java. We have also provided an example... assert keyword. It can be expressed in two ways: assert expression
assert,access modfier - Java Interview Questions
assert,access modfier  can someone explain to me what assertion is all about in java. and what access modifier is transient  Hi Friend.../javatutorials/use-assertion-in-java.shtml Transient Modifier: The transient
Java keyword
Java keyword  Is sizeof a keyword
How to use 'continue' keyword in jsp page ?
How to use 'continue' keyword in jsp page ?       This is detailed java code that shows how to use 'continue' keyword in jsp page. The continue statement skips
this java keyword
this java keyword       "this" is a keyword defined in the java programming language. Keywords... in java programming language likewise the this keyword indicates the following
Explain the use of the ‘LIKE’ keyword used in the WHERE clause?
Explain the use of the ?LIKE? keyword used in the WHERE clause?   Explain the use of the ?LIKE? keyword used in the WHERE clause
Explain the use of the ‘LIKE’ keyword used in the WHERE clause?
Explain the use of the ?LIKE? keyword used in the WHERE clause?   Explain the use of the ?LIKE? keyword used in the WHERE clause
Java: Final keyword
Java NotesFinal keyword The Final word on the final keyword. How often do you use final? Copyleft 2005 Fred Swartz MIT License
transient keyword - Java Beginners
transient keyword  what is transient keyword in java.? plz explain with example
static keyword in java
.style1 { color: #0000FF; } static keyword in java We are going to discuss about static keyword in java. The static keyword is a special keyword in java programming language. A static member belongs to a class
while Java Keyword
while Java Keyword       The while is a keyword defined in the java programming language... to a compiler in java programming language likewise the while keyword indicates
volatile Java Keyword
volatile Java Keyword       The volatile is a keyword defined in the java programming language... to a compiler in java programming language likewise the volatile keyword indicates
true Java Keyword
true Java Keyword       The true is a keyword defined in the java programming language. Keywords... in java programming language likewise the true keyword indicates the following
void Java Keyword
void Java Keyword       The void is a keyword defined in the java programming language. Keywords... in java programming language likewise the void keyword indicates the following
transient Java Keyword
transient Java Keyword       The transient is a keyword defined in the java programming language... to a compiler in java programming language likewise the transient keyword indicates
throws Java Keyword
throws Java Keyword       throws " is a keyword defined in the java programming language. Keywords... in java programming language likewise the throw keyword indicates the following
super Java Keyword
super Java Keyword       The super is a keyword defined in the java programming language... to a compiler in java programming language likewise the super keyword indicates
static Java Keyword
static Java Keyword       The static is a keyword defined in the java programming language. Keywords... in java programming language likewise the static keyword indicates the following
synchronized Java Keyword
synchronized Java Keyword       The synchronized is a keyword defined in the java programming... relevant to a compiler in java programming language likewise the synchronized keyword
Using throw keyword in exception handling in Core Java
Description: Core Java Throw Function is used for throwing the exception. The throw keyword tells the compiler that it will be handled by calling a method... exception need to be thrown from the calling method. Code for Java Throw Exception
try Java Keyword
try Java Keyword       The try is a keyword defined in the java programming language. Keywords... : -- The try keyword in java programming language is used to wrap the code in a block
short Java Keyword
short Java Keyword       The short is a keyword defined in the java programming language. Keywords... in java programming language likewise the short keyword indicates the following
switch Java Keyword
. Example to use the Switch keyword within a class in java programming language... switch Java Keyword       The switch is a keyword defined in the java programming language. Keywords
java - Hibernate
Java assert keyword example  What is the assert keyword? Can anyone explain it with the help of an example
The new keyword in java
The new keyword in java In this section you will learn about new keyword in java. The new keyword is used to create a instance of a class. The new keyword... declaration. Creating  an object by new keyword this is nothing
Return Java Keyword
Return Java Keyword       The return is a keyword defined in the java programming language. Keywords... in java programming language likewise the return keyword indicates the following
throw Java Keyword
throw Java Keyword       "throw " is a keyword defined in the java programming... to a compiler in java programming language likewise the throw keyword indicates
Java final Keyword Example
Java final Keyword Example In this section we will read about the final keyword in Java in various context. final keyword in Java can be used... the final keyword can be used in Java applies its main integrity i.e.
Private Java Keyword
Private Java Keyword       private is a keyword defined in the java programming language. Keywords... in java programming language likewise the private keyword indicates the following
Public Java Keyword
Public Java Keyword       public is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java
Protected Java Keyword
Protected Java Keyword       protected is a keyword defined in the java programming language. Keywords... in java programming language likewise the protected keyword indicates
Super keyword in java
Super keyword in java In this section we will discuss about the super keyword in java. Super is a keyword defined in java. Super is used to refer... "super" keyword. Here is the example to use super to call super class
Case Java Keyword
Case Java Keyword       The java keyword "case" is used to label each branch in the switch statement in java program. In other word Case is a java keyword
Transient Java Keyword
Transient Java Keyword In this section we will discuss about transient keyword in java. Transient is a keyword in java which is used to prevent any variable...? Transient keyword provide you a control on serialization process in java and allow
The for Keyword
Java program. You can also use this keyword for nested loop i.e. loop within loop... The for Keyword       The for is Java keyword that is used to execute a block of code
The void keyword
The void keyword       The void is a keyword defined in the java programming language. Keywords... is the syntax that displays how to use the keyword void.  public class
Java Native Keyword
Java Native Keyword       Native is a Java keyword that is used in method declarations to specify.... This keyword signals to the Java compiler that the function is a native language
Java final keyword
when final keyword use variable constant Exampleof final jeyword in Java...Java final keyword The final is a very important keyword in java, which... with the name "Final" in a Java program. We can have final methods, final
The volatile keyword
; The volatile is a keyword defined in the java programming language. Keywords... is the syntax that shows how to use the keyword volatile. public... keyword is not implemented in many Java Virtual Machines. The volatile
Explain the use of the ?LIKE? keyword used in the WHERE clause? Explain wildcard characters in SQL.
Explain the use of the ?LIKE? keyword used in the WHERE clause? Explain wildcard characters in SQL.  Explain the use of the ?LIKE? keyword used in the WHERE clause? Explain wildcard characters in SQL
Explain the use of the ‘LIKE’ keyword used in the WHERE clause? Explain wildcard characters in SQL.
Explain the use of the ?LIKE? keyword used in the WHERE clause? Explain wildcard characters in SQL.  Explain the use of the ?LIKE? keyword used in the WHERE clause? Explain wildcard characters in SQL
The abstract Keyword : Java Glossary
The abstract Keyword : Java Glossary   ... instantiated than that class use the abstract keyword but this class rather... but will use abstract references in the java program, that always point to objects
The extends keyword
at the following example which illustrate the use of extends keyword in java... in java. The extends is a keyword in java which is used in inheritance. It is used... a method of interface in a class, it must use implement keyword. Example: 
Keyword - this
variables same. Now to avoid the confliction between them we use this keyword... Keyword - this       A keyword is a word having a particular meaning to the programming language
The extends Keyword
The extends Keyword       The extends is a Java keyword, which is used in inheritance process of Java. It specifies the superclass in a class declaration using extends keyword
The While keyword
The While keyword       While is a keyword defined in the java programming language. Keywords... : The while keyword in java programming language specifies a loop  The loop
Hibernate inverse keyword
In this section, you will learn how to use inverse keyword in Hibernate
 

 

 

DMCA.com