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



Home Answers Viewqa Java-Beginners Java IF statement problem
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


anir
Java IF statement problem
1 Answer(s)      3 years ago
Posted in : Java Beginners


Dear Sir/Madam i am using the following code. expected to not have any output but it still showing "welcome".. please help me why it showing "welcome".

class c1
{
int a=5;
while(a>1)
{
a=a+1;
if(a<3)
{
System.out.println("welcome");
        }
    }
}

Advertisement
View Answers

December 16, 2011 at 10:31 AM


This code is not even compiling. it is showing compiler errors.



Related Tutorials/Questions & Answers:
Java IF statement problem
Java IF statement problem  Dear Sir/Madam i am using the following code. expected to not have any output but it still showing "welcome".. please help me why it showing "welcome". class c1 { int a=5; while(a>1
java if statement
java if statement  If statement in Java
Advertisements
Problem Statement : Show Booking System
Problem Statement : Show Booking System  Yashwant Rao Chavan Auditorium has few stage shows running currently. Initialize the Show data by de-serializing a serialized file provided in the Participant_Workspace of the project
goto statement problem. reply fast.
goto statement problem. reply fast.  I have done some operation... properly. I am using goto statement. void main() { float rs, p; char z...(); } problem happening is either its repeating again and again.. or its not repeating
Problem Statement : Show Booking System
Problem Statement : Show Booking System  Yashwant Rao Chavan Auditorium has few stage shows running currently. Now that we have the details of the shows that are currently running, we will book our tickets using following method
Switch Statement with Strings in Java
Switch Statement with Strings in Java  Switch Statement with Strings in Java
if else statement in java
if else statement in java  if else statement in java explain with example
JAVA statement - Java Beginners
JAVA statement  The import statement is always the first noncomment statement in a Java program file.Is it true?  Hi Friend, No,it is not true.If your class belongs to a package, the package statement should
if else statement in java
if else statement in java  explain about simple if else statement and complex if else statement in java with an example
Java callable statement
Java callable statement  What is callable statement? Tell me the way to get the callable statement
conditional statement in java
conditional statement in java  Write a conditional statement in Java   Logical and comparison statements in OOPs are also know as conditional statements. You can learn "How to write conditional statement in Java " from
Java switch statement
Java switch statement  What restrictions are placed on the values of each case of a switch statement
GOTO Statement in java
GOTO Statement in java  I have tried many time to use java goto statement but it never works i search from youtube google but e the example on net are also give compile error. if possible please give me some code with example
ELSE STATEMENT!! - Java Beginners
ELSE STATEMENT!!  Hi! I just want to know why doesn't my else statement works? Else statement is there in the code below which is: else JOptionPane.showMessageDialog(null, n+ " is not in the array!");//doesn't work
If statement in java 7
If statement in java 7 This tutorial describes the if statement in java 7. This is one kind of decision making statement. There are various way to use if statement with else - If Statement :  If statement contains one boolean
Switch Statement in java 7
Switch Statement in java 7 This tutorial describes the if statement in java 7. This is one kind of decision making statement. Switch Statements : The switch statement is used when you want to test many statements based on some
Break Statement in java 7
Break Statement in java 7 In this tutorial we will discuss about break statement in java 7. Break Statement : Java facilitate you to break the flow... java provides the way to do this by using labeled break statement. You can jump
Switch Statement example in Java
more about the switch statement in Java. The following java program tells you... Switch Statement example in Java        This is very simple Java program
Java - Continue statement in Java
Java - Continue statement in Java       Continue: The continue statement is used in many programming languages such as C, C++, java etc. Sometimes we do not need to execute some
for statement
for statement  for(int i=0;i<5;i++); { system.out.println("The value of i is :"+i); } if i end for statement what will be the output   got the answer.. it displays only the last iteration that is "The value of i
Continue Statement in java 7
Continue Statement in java 7 In this tutorial we will discuss about continue statement in java 7. Continue Statement : Sometimes you need to skip block... statement in loops. In java 7, Continue statement stops the current iteration
Continue statement in java
Continue statement in java In this section we will discuss about continue statement in java. continue is one of the branching statement used in most of the programming languages like C,C++ and java etc. Sometime we need to skip some
java Problem
java Problem  I want to create a binary tree for displaying members in Downline. i am creating a site for MLM(Multi-Level MArketing). tree must be dynamically populated from database. is there any help for me. Thanks in advance
JAVA Problem
JAVA Problem  Write a program that takes two parameters 1. a word 2. an array of words It should then remove all instances of the word in the array. For Example: INPUT word="ravi" word_array = ["Chethan Bhagat
count statement that saves results on a variable in a java bean
count statement that saves results on a variable in a java bean  Hello i want to ask you where is the problem and my programme give me only null...; Statement statement = null; String SQLStr ; String retString
count statement that saves results on a variable in a java bean
count statement that saves results on a variable in a java bean  Hello i want to ask you where is the problem and my programme give me only null...; Statement statement = null; String SQLStr ; String retString
Java Switch Statement
Java Switch Statement       In java, switch is one of the control statement which turns the normal flow... more about the switch statement click on:   http:/www.roseindia.net/java
Java Break Statement
Java Break Statement      ... is of unlabeled break statement in java. In the program break statement....           Syntax for Break Statement in Java
Break statement in java
Break statement in java Break statement in java is used to change the normal control flow of  compound statement like while, do-while , for. Break statement is used in many languages such  C, C++  etc. Sometimes it may
Java error missing return statement
Java error missing return statement       Java error missing return statement are those error in Java that occurred when a programmer forget to write
Java Error In comapitable Type in statement - Java Beginners
Java Error In comapitable Type in statement  Here I want to Check...; //Statement st; faculty3() //constructor { j=new JFrame("faculty"); j1...; PreparedStatement st; //Statement st; faculty3(){ j=new JFrame("faculty
 

 

 

DMCA.com