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

 
 


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

Hi,

What is the purpose of assert keyword used in JDK?

Thanks
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 Pages:
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
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
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
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
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
Return keyword
Return keyword  how do we use return in methods?   Java use of return keyword import java.util.*; public class ReverseString{ public... at Return Keyword
Dynamic keyword
Dynamic keyword  hi....... What is the dynamic keyword used for in flex? give me the answer ASAP Thanks  Ans: Dynamic keyword... at run time. For example: In Java, if you?ve created an object from a particular
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
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
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
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
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
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
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
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
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
Java keyword
Java keyword  Is sizeof a keyword
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
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
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
The interface keyword
The interface keyword       In java programming language the keyword interface in java is used... use of it.   All the variables defined in java are constant
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
The false Keyword
. It is seem like keyword; therefore you cannot use them as identifiers in your programs... The false Keyword         The false is a keyword, which represents one of the two legal
The double Keyword
The double Keyword       The double is a Java keyword that may not be used as identifiers i.e. you... a variable used to hold such a decimal number, you can use the double keyword
The float Keyword
The float Keyword         The float is a Java keyword that may not be used as identifiers i.e. you cannot declare a variable or class with this name in your Java program
Keyword- transient
Keyword- transient       The transient keyword is used to indicate to the JVM that the indicated... the object is archived. At that time, the transient marker is ignored by the Java
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 if Keyword
is executed. The if is a java keyword that may not be used as identifiers i.e. you... The if Keyword         The if is a keyword, which is used to perform the selection
The finally Keyword
The finally Keyword         The finally is a Java keyword that is used to define a block... or not. This is a Java keyword therefore it may not be used as identifiers i.e. you
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
final keyword
final keyword  why is final keyword used in java
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
transient keyword
transient keyword  how to use transient keyword?   Hi Friend, The transient keyword is used to indicate that the member variable should not be serialized when the class instance containing that transient variable
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
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
transient keyword - Java Beginners
transient keyword  what is transient keyword in java.? plz explain with example
SQL as Keyword
SQL as Keyword      ... with the SQL Keywords used in SQL Command. In this Tutorial, we use various keywords like, create table keyword is used to create a table Stu_Table
Final Keyword
Final Keyword  hello, What is final?   hii In case of class if we use final then this class can not be extended or final class may not be subclassed. A final method can't be overridden when its class is inherited
static keyword
static keyword  Hii, In which portion of memory static variables stored in java. Is it take memory at compile time? thanks deepak mishra
The final Keyword
The final Keyword       The final is a keyword. This is similar to const keyword in other languages. This keyword may not be used as identifiers i.e. you cannot declare
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
java - Hibernate
Java assert keyword example  What is the assert keyword? Can anyone explain it with the help of an example

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.