Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3636780
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:04:35+00:00 2026-05-19T01:04:35+00:00

I noticed that java (hence probably C) has no problem with this: while(condition1) {

  • 0

I noticed that java (hence probably C) has no problem with this:

while(condition1) {
    //do somethin'
} while(condition2);

Is this the same as:

while(condition1 && condition2) {
    //do somethin'
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:04:35+00:00Added an answer on May 19, 2026 at 1:04 am

    No, you have two loops.

    while(condition1) {
      // do something
    }
    
    while(condition2); // second loop which does nothing.
    

    The second loop is the same as

    while(condition2) { }
    

    EDIT: My suggestion is to use the automatic formatter in your IDE regularly. Otherwise you can create formatting which suggests the code does things it doesn’t.

    example 1

    if (condition)
        statement1;
        statement2;
    statement3;
    

    In this example, it appears that the first two statements are part of the if condition, but only the first is.

    example 2

    http://www.google.com/
    statement;
    

    Doesn’t look like legal Java, but it is, not for the reasons the formatting suggests 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have noticed that while using the Substance UI for Java that when I
I started developing my application in AppEngine Java, however I noticed that Facebook has
We noticed that lots of bugs in our software developed in C# (or Java)
I was looking at the Java code for LinkedList and noticed that it made
I'm relatively new to Threading in Java and I've noticed that everytime I use
I've noticed in many places in Java (C# included), that many getter methods are
I noticed that my Designer.vb file of one of my forms has a lot
I just noticed that java.beans.Introspector getBeanInfo does not pickup any superinterface's properties. Example: public
I noticed that in Java(doc) there exists something like @inheritDoc, so that comments from
I noticed that Real Time Java 2.2 was released back in September, seems to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.