Skip to main content

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.                                                                                            [10 Marks]
                                                                            OR
(b) (i) Write a program to sum all the elements of an double type array containing 10 elements.                                                                                                                                                         [5 Marks]
     (ii) Write a program in which define a method to convert an array of double values into array of int values.Invoke that method from the main() method for displaying the output.             [5 Marks]


2 (a) Create a class Employee with properties name, salary, department and age. Create method read() in Employee class to read these properties from keyboard and display() method to display these properties. Create another class TestMyObject with main method to invoke read() and display() methods.                                                                                                                               [10 Marks]
                                                                           OR
(b) (i) Java is platform independent, Justify the statement and how the platform independence is achieved?                                                                                                                             [5 Marks]
    (ii) Write a program to demonstrate the use of any 5 methods of String class.              [5 Marks]

3 (a) What do you mean by Nested class in Java? Differentiate between the Inner class and Local class in java with an appropriate example.                                                                          [10 Marks]

                                                                            OR
(b)(i) Write a program to define two interfaces X and Y each having a default method and an abstract method. Now define a class Test which inherits both X and Y and override the abstract method of X but not of Y.
Create a class MyClass which inherits Test and in main method create the object of MyClass and invoke all the methods.                                                                                                       [5 Marks]

(ii) Define Functional Interface and Lambda Expressions in Java with a suitable example.  [5 Marks]


4 (a) Write a program to define a custom exception InvalidStringException such that it displays the message "String is not accepted" when message is printed. Create a class TestString which reads a String at run-time and if the String is having less than 6 characters then throw the InvalidStringException and display the message in catch block.                                     [10 Marks]

                                                                          OR
(b)(i) Differentiate throw and throws exception handling with java code in detail.         [5 Marks]                           
(ii)  Write a program to create a class named “Vehicle” having attributes name, mileage and price and a parameterized constructor to initialize all the attributes. Vehicle must contain a method public int getPrice() to return the price of the vehicle.
Create 3 Vehicle objects and write them in a file named “record.doc”. Write a method to display the name of the Vehicle with minimum price. (Use ObjectOutputStream)                            [5 Marks]


5 (a) Write a program to create two arraylists containing "George","Jim", "John", "Blake", "Kevin", "Michael" and "George","Katie", "Kevin", "Michelle", "Ryan" respectively and find their union, difference, and intersection using appropriate methods of ArrayList class.                    [10 Marks]
                 
                                                                       OR
  (b)(i) What do you mean by Generics? Write a program to create a generic class and instantiate it.                                                                                                                                             [5 Marks]
   (ii) Differentiate between the iterator and list iterator using an appropriate example.                                                                                                                                                             [5 Marks]


-----------------------------------------------------------------------------------------------------------------------------

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. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
    Digital Marketing Training in Bangalore

    ReplyDelete
  3. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
    Click here:
    python training in chennai


    Click here:
    python training in tambaram

    ReplyDelete
  4. Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
    AWS Training in chennai

    AWS Training in bangalore

    ReplyDelete
  5. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command

    Blue Prism Training in Pune

    Blueprism training in tambaram

    Blueprism training in annanagar

    ReplyDelete
  6. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 

    Data Science Training in Chennai
    Data science training in bangalore
    Data science online training
    Data science training in pune
    Data Science training in kalyan nagar
    Data Science training in OMR
    selenium training in chennai

    ReplyDelete
  7. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    java online training | java training in pune

    java training in chennai | java training in bangalore

    ReplyDelete
  8. I got a lot of information from this blog. Thanks a lot. World's first memory dump analysis tool to find out amount of memory wasted by the application due to inefficient programming. Tool’s inbuilt AI intelligence recommends solution to fix the identified inefficiency.Heap Hero

    ReplyDelete
  9. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    python training in pune | python training institute in chennai | python training in Bangalore

    ReplyDelete
  10. Thank you for your post. This is excellent information.............

    java training in chennai

    selenium training in chennai

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

    Microsoft Azure online training
    Selenium online training
    Java online training
    Java Script online training
    Share Point online training

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. Appreciating the persistence you put into your blog and detailed information you provide.

    Oracle dba training chennai | oracle dba training course chennai

    ReplyDelete
  14. 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
  15. Nice article . you have explain step by step Java file examples

    ReplyDelete
  16. better to visit this site rather than any other it will be better oracle training in chennai

    ReplyDelete
  17. "I am looking for and I love to post a comment thatExcelR Online data science training
    ""The content of your post is awesome"" Great work!"

    ReplyDelete
  18. Very nice blog. Thanks for sharing your valuable content with us. Maybe you want to implement your blog then
    Visit the below blog the most interesting ideas and opportunities are there.
    Devops training in Bangalore
    Devops Course in Bangalore

    ReplyDelete
  19. This helps so much to all the beginners. Thank you. Lots of support. Keep going.
    Intelligent Systems in Your Everyday Life Post Office automatic address recognition
    AI Training in Bangalore

    AI Course in Bangalore

    ReplyDelete
  20. whenever I am feeling boring I am not playing some kinds of games but on the opposite, I am starting to find some blogs where I can find helpful articles but I am not commenting there but this article really is an awesome article I ever say thanks for sharing it with us.
    if you have an interest in web designing or logo designing then visit us?
    Logo Designers

    ReplyDelete
  21. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.

    Data Science Training in Hyderabad

    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