Skip to main content


What will be the output? 

1.
class DemoString 
{
   public static void main(String...rk)      
      {
          StringBuilder b = new StringBuilder("abcdef");
          b.delete(4,6);
          b.ensureCapacity(22);
          System.out.print(b.capacity()); 
          b.ensureCapacity(23);
          System.out.print(b.capacity());
    }
}

2.
     import java.time.*;
import java.time.format.*;
class DemoDateTime
{
   public static void main(String...rk)
    {
         DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yy/mm/dd");
LocalDateTime ldt = LocalDateTime.of(2015, 10, 10 , 11, 22);
    System.out.println(dtf.format(ldt));       

    }

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. Wow.. well good Blog Sir. You know about all concepts of Java. It is so good to learn something from your Blogs Sir.
    For more Information Visit Our Website Web Designing Course in Rohini

    ReplyDelete
  3. most wonderfull Article, Thanks for sharing!
    Best Apps for Coding Java

    ReplyDelete
  4. Useful article. Thanks for writing such an informative article.
    Regards
    Java Training Institute in Kolkata

    ReplyDelete
  5. APTRON Gurgaon located in different places in Gurgaon. We are the best Training Institute offers certification oriented Core Java Training in Gurgaon. Our members will be eligible to clear all type of interviews at end of our sessions. We are building a team of Core Java trainers and members for their future help and assistance in subject.
    For More Info: Core Java Course in Gurgaon

    ReplyDelete
  6. Good Post! Thank you so much for sharing the post, it was so good to read and useful to improve
    Java Training in Electronic City

    ReplyDelete
  7. This post and the whole blog is helpful for Java developers. Thanks for creating this website.
    Spring interview Questions

    ReplyDelete
  8. Nice Blog!!! keep Posting!!!

    To get taxi from Siliguri to Darjeeling you can check our site www.99carrentals.com

    ReplyDelete

Post a Comment

Popular posts from this blog

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...

Practice Set: Unit-4

                                                                                                                Practice Set: Unit 4 1. What are the uses of super keyword in Java? Explain with a suitable example. 2. What are the various uses of final keyword in java? An abstract method can not be declared final. Why? 3. Differentiate between Abstract class and Interface. What do you mean by Functional interface and Lambda Expression?  ...

ETE Practice Set-1

                                                                 Mock Test-1 -----------------------------------------------------------------------------------------------------------------------------   1 (a) Write a program that reads 10 integers between 1 and 100 and counts the occurrences of each. Assume the input ends with 0.                                                         ...