Skip to main content

Brainstorming



What will be the output of the following Programs?

A.
class If_Demo
{
  public static void main(String...rk){
   int i =10;
   if(true)
    {
        i=20;
    }
   else
       System.out.print(i);

   System.out.println(++i);
  }
}

B.
class WhileDemo
{
  public static void main(String...rk){
   int i =10;
   while(false)
    {
        i=20;
    }
    System.out.println(++i);
  }
}

Comments

  1. Hello Everybody,
    My name is Mrs Sharon Sim. I live in Singapore and i am a happy woman today? and i told my self that any lender that rescue my family from our poor situation, i will refer any person that is looking for loan to him, he gave me happiness to me and my family, i was in need of a loan of S$250,000.00 to start my life all over as i am a single mother with 3 kids I met this honest and GOD fearing man loan lender that help me with a loan of S$250,000.00 SG. Dollar, he is a GOD fearing man, if you are in need of loan and you will pay back the loan please contact him tell him that is Mrs Sharon, that refer you to him. contact Dr Purva Pius,via email:(urgentloan22@gmail.com) Thank you.

    ReplyDelete
  2. Interesting program. stay coding. Universal Garbage Collection log analyzer that parses any format of Garbage collection logs and generates WOW graphs & AHA metrics. Inbuilt intelligence has ability to discover any sort of memory problems.Excellence & Simplicity Devops tools for cloud.
    Gceasy

    ReplyDelete
  3. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

    angularjs Training in bangalore

    angularjs Training in electronic-city

    angularjs Training in online

    angularjs Training in marathahalli

    ReplyDelete
  4. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    python training Course in chennai | python training in Bangalore | Python training institute in kalyan nagar

    ReplyDelete
  5. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    Java interview questions and answers | Core Java interview questions and answers

    ReplyDelete
  6. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
    Data Science training in Chennai | Data science training in bangalore

    Data science training in pune | Data science online training

    Data Science Interview questions and answers

    ReplyDelete
  7. Nice post, thank you.
    For java interview programs visit:
    Java programming

    ReplyDelete
  8. Information technology has much more to serve the students. There is wide range of services and scope for students that can help them to improve their future. We are also providing Training to the students at very low and reasonable prices that a student or another person can easily afford and make their future bright and shine. For more details you can visit our website and know more about our services 6 Months industrial training in Chandigarh python training in mohali android training in chandigarh

    ReplyDelete
  9. "very nice and amazing blog you have written i have read all this blog many things mentioned in this blog please keep updating the blog and posting because Dot net is a very easy and simple language. it is easy to understand and use and also support multiple languages.
    Dot Net training in Chandigarh
    Data Science training Chandigarh
    Big data training Mohali"

    ReplyDelete
  10. Hi,
    Good job & thank you very much for the new information, i learned something new. Very well written. It was sooo good to read and usefull to improve knowledge. Who want to learn this information most helpful. One who wanted to learn this technology IT employees will always suggest you take big data hadoop training in pune. Because big data course in pune is one of the best that one can do while choosing the course.

    ReplyDelete
  11. Very well and informative post..
    Thanks for sharing with us,
    We are again come on your website,
    Thanks and good day,
    Please visit our site,
    buylogo

    ReplyDelete
  12. Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here
    Java training in Chennai

    Java Online training in Chennai

    Java Course in Chennai

    Best JAVA Training Institutes in Chennai

    Java training in Bangalore

    Java training in Hyderabad

    Java Training in Coimbatore

    Java Training

    Java Online Training

    ReplyDelete
  13. It is an informative blog. I would like to know more information. Anyway thanks a lot for sharing this post. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervour like mine to grasp great deal more around this condition.Data Science Training In Chennai

    Data Science Online Training In Chennai

    Data Science Training In Bangalore

    Data Science Training In Hyderabad

    Data Science Training In Coimbatore

    Data Science Training

    Data Science Online Training

    ReplyDelete
  14. Hello.
    Are you looking for an amazing logo design for your business with 50% off I expect You will be impressed with us.Logo Designers

    ReplyDelete

Post a Comment

Popular posts from this blog

Practice MCQs

  1. What will be the Output of the following code? class X{                  static int x = 1;                        static class Y {                              static int y = x++;                                static class Z                                                                       {                                                                                         static int z = ++y;                                                                        }                                               }                }   class MainClass{     public static void main(String[] rk)    {                             System.out.print(X.x);                                             System.out.print(X.Y.y);                             System.out.print(X.Y.Z.z);         } } A. 113 B. 123 C. 111 D. None of These Ans: A 2.  Which of the following statement is TRUE about t he following code? public class Outer  {    private i

Practice Set

1. Write a program to create a class Voter which contains attributes name, date_of_birth and voter_id and voter has a Voter_Card. Provide appropriate constructor to initialize all the attributes of the Voter but voter id must be assigned automatically only when the age of the voter is greater than or equal to 18 years. VoterCard is a nested class with attributes voter_id and Voter_name. Make sure that voter card is created only when user is a valid voter and if it is already created then must not be assigned the new voter id. 2. Write a program to define two interfaces UGC and AICTE both having a default method int getAdmission() to take the admission and an abstract method String payFee(). getAdmission() in UGC must ask the percentage in qualifying exam and if the percentage >= 60 then generate the registration number and return. getAdmission() is AICTE must ask the user to join the counseling after 5 days and display the date of counseling and return the counseling token numb

Mock Test - 1

1. Which of the following is a byte stream class? A. ObjectInputStream B. Writer C. PrintWriter D. Scanner Ans: A 2. Which exception is thrown by read() method in InputStream class? A. IOException B. InterruptedException C. FileNotFoundException D. None of These Ans: A 3. Which of the following class is subclass of FilterInputStream? A. InputStream B. ObjectOutputStream C. FileInputStream D. BufferedInputStream  Ans: D 4. Which of these class contains the print() and println() methods? A. System B. out C. PrintStream D. BUfferedOutputStream Ans: C 5. Which of these is a method to clear all the data present in output buffer without terminating the stream? A. clear() B. fflush() C. flush() D. close() Ans: C 6. Which of these classes defined in java.io and used for file-handling are abstract? (i) InputStream        (ii) PrintStream    (iii) Reader        (iv) FileInputStream A. Only i     B. i and ii    C. Only iii    D. i and iii Ans: D 7. What is the output of this program? class MyE