Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Monday, November 30, 2015

Adilabad Fort, Mehrauli - Badarpur Rd, Tughlakabad, New Delhi, Delhi 110044


Adilabad Fort, Mehrauli - Badarpur Rd, Tughlakabad, New Delhi, Delhi 110044


Tughlaqabad Fort (Hindi: तुग़लक़ाबाद क़िला, Urduتغلق آباد قلعہ‎ ،Tughlaqabad Qila) is a ruined fort in Delhi, stretching over 6 km, built byGhiyas-ud-din Tughlaq, the founder of Tughlaq dynasty, of the Delhi Sultanate of India in 1321, as he established the third historic city of Delhi, which was later abandoned in 1327. It lends its name to the nearby Tughlaqabad residential-commercial area as well as the Tughlaqabad Institutional Area. Tughalaq also built Qutub-Badarpur Road, which connected the new city to the Grand Trunk Road. The road is now known as Mehrauli-Badarpur Road.[1] Also nearby is the Asola Bhatti Wildlife SanctuaryDr. Karni Singh Shooting Range and Okhla Industrial Area.




History[edit]

Stone tablet by the Archaeological Survey of India
Ghazi Malik was a feudatory of the Khalji rulers of Delhi, India. Once while on a walk with his Khilji master, Ghazi Malik suggested that the king build afort on a hillock in the southern portion of Delhi. The king jokingly told Ghazi Malik to build the fort himself when he would become king.
In 1321 AD, Ghazi Malik drove away the Khaljis and assumed the title of Ghias-ud-din Tughlaq, starting the Tughlaq dynasty. He immediately started the construction of his fabled city, which he dreamt of as an impregnable, yet beautiful fort to keep away the Mongol marauders. However, destiny would not be as he would have liked.

The Curse of Nizamuddin Auliya[edit]

Ghias-ud-din is usually perceived as a liberal ruler. However, he was so passionate about his dream fort that he issued a dictate that all labourers in Delhi must work on his fort. Saint Nizamuddin Auliya, a Sufi mystic, got incensed as the work on his baoli (well) was stopped. The confrontation between the Sufi saint and the royal emperor has become a legend in India. The saint uttered a curse which was to resonate throughout history right until today: Ya rahey ujjar, ya basey gujjarwhich can roughly be translated to "either remain inhabited or would live gujjars". So, after the fall of sultanate, Gujjars of the area captured the Qila and till date village Tughlakabad is situated in it.

The Death of the Emperor[edit]

Another of the saint's curses was Hunuz Dilli dur ast (Delhi is still far away). The Emperor was engrossed in a campaign in Bengal at this time. He was successful and was on his way to Delhi. However, his son, Muhammad bin Tughlaq, met him at Kara in Uttar Pradesh. Allegedly at the prince's orders, a Shamiana (Tent) fell on the Emperor, who was crushed to death (1324 AD).

Share:

Friday, November 27, 2015

LATEST IT JOBS

LATEST IT JOBS

State /Central Govt Organization
Post Name - Total Vacancies
Last Date for Apply
Full Details
Military Engineer Services(MES)
Mate Tradesman - 762
26/12/2015
Naval Dockyard Mumbai
Tradesman Mate - 325
02/12/2015
Ordnance Factory Muradnagar
Tradesman (Semi-Skilled) - 116
19/12/2015
DSSSB
Class-IV Posts - 808
26/11/2015
DMRC
Maintainer - 634
25/11/2015
UPSSSC
Instructors - 559
02/12/2015
High Court of Allahabad
Various Class IV Posts - 252
26/11/2015
Naval Dockyard Visakhapatnam
Tradesman Skilled - 161
30/11/2015
OCF Shahjahanpur
Industrial Posts - 160
Starts from 26/10/2015
NPCIL
Stipendiary Trainee Maintainer (ITI) - 31
30/11/2015
ALIMCO Kanpur
Electroplater, Plant Operator,Fitter, Turner, Electrician, Machinist etc. - 21
07/12/2015
IGCAR
Stipendiary Trainee Category-II - 11
20/11/2015
Hindustan Paper Corporation Limited (HPC)
Technician(Vocational) Apprentices - 09
30/11/2015
High Court of Allahabad
Electrician - 09
26/11/2015
C/O 99 APO
Tradesman Mate - 08
05/12/2015
PGIMER Chandigarh
Technician, Lift Operator - 07
07/12/2015
CLRI Chennai
ITI Trade Apprentice - 06
27/11/2015
NISCAIR
Technician (1) - 04
23/11/2015
HQ Eastern Air Command IAF
Painter, Carpenter - 03
30/11/2015
NFC Hyderabad
Technician / B - 02
05/12/2015
HQ Maintenance Command IAF
Fitter Mechanical Transport, Tailor - 02
23/11/2015

Share:

NIIT COURSES FEE DETAILS

NIIT COURSES FEE DETAILS

NIIT Limited is a global talent development company was established in 1981.
NIIT is the world's largest Information Technology training and education company.

Courses Offered:
NIIT offered following of courses:
1. GNIIT (Software Engineering)
2. GNIIT (Systems Engineering and Networking)
3. GNIIT (Business System & Information Management)
4. GNIIT (Information Systems Management)


Fee: (Tentative)

Here you are looking for Fee of NIIT courses:
1. GNIIT (Software Engineering) program fee is 137000.00 for 3 years.
2. GNIIT (Systems Engineering and Networking) program fee is 42500.00 for 3 years.
3. GNIIT (Business System & Information Management) program fee is 117000.00 for 3 years.
4. GNIIT (Information Systems Management) program fee is 96500.00 for 3 years.
Share:

SOFTWARE ENGINEERING GOVT JOBS

SOFTWARE ENGINEERING GOVT JOBS

Govt Organization
Name of Post - Total Vacancies
Last Date for Apply
Further Details
Engineering Projects (India) Limited
Manager GR- I (IT), Assistant Manager (IT) - 04
25/11/2015
IIT Bhubaneswar
System Administrator, Programmer - 03
30/11/2015
NBRC
Information Scientist - 02
20/11/2015
Tata Memorial Centre
Data Manager - 01
30/11/2015
MCA Govt Jobs
MCA Qualification Govt Posts – Above 100 Vacancies
November 2015
Data Entry / Computer Assistant Jobs
Data Entry Operator, Computer Assistant – Various Posts
November 2015

Share:

Gir National Park

Gir National Park

At a GlanceGir National Park is the only remaining habitat of the Asiatic lion, which has been confined to this forest, since 1884 (about 239 lions were reported in 1985).The Asiatic lion is slightly smaller than its African cousin, nevertheless, a large male lion of the Gir is quite a sight to behold. The best way to observe the big cats is, of course, in their natural surroundings, at dawn and dusk, when they are on the prowl. The Forest Department does arrange lion shows every Sunday, where the spectators can watch prides of lions on the hunt. There are guided trips available, to watch these magnificent animals from a very close range. Wildlife viewing in the Gir is best done, by driving around the forest. The best drives from Sasan are, to Baval Chowk and Kankai, to Chodavdi and Tulsishyam, and to Kamaleshwar dam. Though a sturdy car would do, a jeep is definitely more appropriate.
ClimateThe Gir Forests are usually dry and arid. The greenery in the forests can be seen during the monsoon season. The summers, from April to June, are harsh with temperatures rising to 40°C. the winters, from December to February are cool and comfortable. The tourists need to carry light woolens during the summers and heavy woolens during the winters.
FloraAcacia and Banyan trees. A distinct belt of vegetation is found along the main rivers and streams. Species like the Jambu, Karanj, Umro, Vad, Kalam, Charal, Sirus and Amli are found here. These trees are mostly broad leaved and evergreen, giving the area a cool shade and the moisture content.

FaunaIn India the Lion population is spread across the states of Rajasthan, Gujarat, Haryana, Punjab, Uttar Pradesh and Madhya Pradesh. But Gir is not just about Lions, the second most commonly found predator in the Gir is Leopard. Infact, Gir national park is also home to one of the largest Leopard populations in any park in India, and especially in the hotter season they can sometimes be seen at night close to the lodges.

Other animal residents of the Gir national park are Sambar Deer, Chital Spotted Deer, Nilgai Antelope, Chowsingha Four-Horned Antelope, Chinkara Gazelle, Wild Boar, Langur Monkey, Jackal, and Hyena and numerous birds like Paradise Flycatcher, Bonneli's Eagle, Crested Serpent Eagle, Woodpeckers Flamingo etc.
Travel TipsDo not disturb the animals during day time as most of the nocturnal animals sleep during day time.
Best Time to VisitWildlife enthusiasts can visit Gir park throughout the year, but the best period to visit the Gir Sanctuary is between the months of November and June.
Share:

Niit contact number and centers

Niit contact number and centers


NIIT
NIIT
D C Chowk
New Delhi
1800 102 6448
CALL
DIRECTIONS
NIIT
NIIT
HD-7, 2nd Floor, Main Metro Road, Opp. Metro Pillar No. 363, Pitampura
New Delhi
011 4711 1999
CALL
DIRECTIONS
N.I.I.T
N.I.I.T
Shivaji Place
New Delhi
DIRECTIONS
NIIT
NIIT
Guru Virjanand Marg
New Delhi
1800 102 3233
CALL
DIRECTIONS
NIIT MODEL TOWN CENTRE
NIIT MODEL TOWN CENTRE
D 2/9,Model Town III, Opp D Park
New Delhi
011 4311 1555
CALL
DIRECTIONS
NIIT Janakpuri
NIIT Janakpuri
B1/624, Janakpuri, Near District Centre, Opp Pillar No 574
New Delhi
011 2553 4455
CALL
DIRECTIONS
Niit Smartserve Limited
Niit Smartserve Limited
223-224, Udyog Vihar, Phase-1
Gurgaon
0124 400 2702
CALL
DIRECTIONS
NIIT
NIIT
Opposite Leelavati Vidya Mandir School, Gulabi Bagh, 5, Inder Chandra Shastri Marg
New Delhi
011 2364 2225
CALL
DIRECTIONS
NIIT
NIIT
Shop No. 175, 1st Floor, Rajendra Bhavan, Rajendra Place
New Delhi
011 2574 2300
CALL
DIRECTIONS
Niit
Niit
Wz-43c/1, Main Jail Road, Nangal Raya, Lajwanti Garden, Nangal Raya
New Delhi
011 6549 8969
CALL
NIIT
NIIT
Palam Dabri Marg, Mahavir Enclave Part 2
New Delhi
1800 102 6448
CALL
DIRECTIONS
NIIT Delhi Dwarka Centre
NIIT Delhi Dwarka Centre
3rd Floor, lot No. 09 Mlu,sector-6 Pappankala,Dwarka
New Delhi
011 2508 4000
CALL
DIRECTIONS
NIIT
NIIT
A-1, Hamilton House, Opp Palika Parking, Connaught Place
New Delhi
011 4151 6457
CALL
DIRECTIONS
NIIT
NIIT
Plot No. 1, Furniture Market, Krishna Mandir Chowk, Najafgarh Phirni Rd
New Delhi
1800 102 6448
CALL
DIRECTIONS
NIIT
NIIT
House No. 4435/7, Ansari Rd
New Delhi
DIRECTIONS
NIIT Centre
NIIT Centre
Munirka Enclave
New Delhi
011 4104 2994
CALL
DIRECTIONS
NIIT Delhi South Extn Centre
NIIT Delhi South Extn Centre
Niit Delhi D-5 South Extn Centre, South Ex Part-2 .
New Delhi
DIRECTIONS
NIIT
NIIT
G-83, Above HDFC Bank, Near Sagar Ratna, Preet Vihar
New Delhi
011 4242 1369
CALL
DIRECTIONS
Faiz Raza Khan, 4th floor, 23-Kilokri Village, Near -CTC Plaza
Faiz Raza Khan, 4th floor, 23-Kilokri Village, Near -CTC Plaza
Mahatma Gandhi Marg, Block A, Maharani Bagh
New Delhi
096507 33569
CALL
DIRECTIONS
NIIT
NIIT
D-2, D-Block Market,Sant Lal Gupta Marg, Phase-I,Vivek Vihar, Opposite Balaji Mandir
New Delhi
099100 23142
CALL
DIRECTIONS
NIIT
NIIT
C-4, Second Floor, Guru Gobind Singh Marg, Malviya Nagar
New Delhi
011 4053 4716
CALL
DIRECTIONS
NIIT Delhi Dilshad Garden Centre
NIIT Delhi Dilshad Garden Centre
Dilshad Colony
New Delhi
011 6567 3198
CALL
DIRECTIONS
NIIT
NIIT
95, Janta Quaters
New Delhi
092107 32613
CALL
DIRECTIONS
Niit Imperia
Niit Imperia
Delhi Mcr, Ground Floor, 1 & 2, Charanjeev Travels, Nehru Place, Nehru Place
New Delhi
011 6000 6448
CALL
NIIT
NIIT
C Block,Ocean Plaza,3rd Flr, Main Chauraha
Ghaziabad
098716 03331
CALL
DIRECTIONS
NIIT Foundation
NIIT Foundation
New Delhi
096503 37304
CALL
DIRECTIONS
NIIT
NIIT
TA-109, Main Okhla Rd, Opp Khana Khazana, Near Tara Apartments, Tuglakhabad Extension
New Delhi
011 6459 1800
CALL
DIRECTIONS
NIIT
NIIT
A-14/28B, DLF Phase 1, Gate no 10, Above Fitline
Gurgaon
0124 405 9168
CALL
DIRECTIONS
NIIT
NIIT
SCO -26,Old Delhi Road, Sector 14, Near ICICI Bank
Gurgaon
0124 430 0462
CALL
DIRECTIONS
NIIT Limited
NIIT Limited
B-234, Industrial Area
New Delhi
011 4140 7000
CALL
DIRECTIONS
NIIT Noida Centre
NIIT Noida Centre
Pocket C
Noida
1800 102 6448
CALL
DIRECTIONS
NIIT Sarita Vihar Centre
NIIT Sarita Vihar Centre
3rd Floor, LSC Building, Plot No 7, H Block market, Sarita Vihar
New Delhi
011 4057 0039
CALL
DIRECTIONS
NIIT Store
NIIT Store
Shop No.C-109, Okhla Phase I
New Delhi
011 4161 3809
CALL
DIRECTIONS
NIIT
NIIT
601-602, 6th Floor, Ocean Complex, Opp.The Great India Place, Sector-18
Noida
1800 180 6448
CALL
DIRECTIONS
NIIT Vaishali Centre
NIIT Vaishali Centre
Hall No. 2, II Floor, Mahalaxmi Tower,, Sector -4, Vaishali,
Ghaziabad
0120 437 6700
CALL
DIRECTIONS
NIIT Delhi Yamuna Vihar Centre
NIIT Delhi Yamuna Vihar Centre
B2/20A, Yamuna Vihar
New Delhi
011 4308 3550
CALL
DIRECTIONS
NIIT Delhi Mayur Vihar Centre
NIIT Delhi Mayur Vihar Centre
A-6 , veer complex,3rd floor, above J&k bank,acharya niketan
New Delhi
011 3192 1222
CALL
DIRECTIONS
NIIT Technologies Ltd
NIIT Technologies Ltd
Corporate Heights,Tapasya Building,Plot No.5,Sector 126,Greater Noida Expressway
Noida
0120 711 9101
CALL
DIRECTIONS
NIIT Delhi Vikaspuri Centre
NIIT Delhi Vikaspuri Centre
33
New Delhi
011 2562 1062
CALL
DIRECTIONS
NIIT Delhi Palam Road Centre
NIIT Delhi Palam Road Centre
R.Z.D/ 3A, Main Road, Dadri Mahavir Enclave, Palam Road
New Delhi
011 6549 8968
CALL
DIRECTIONS
NIIT Delhi Model Town Centre
NIIT Delhi Model Town Centre
D-2/9, odel Town III
New Delhi
011 2741 9515
CALL
DIRECTIONS
NIIT
NIIT
C-56A/28, Sector - 62, Gautam Budha Nagar, Near HDFC Bank
Noida
0120 457 4851
CALL
DIRECTIONS
NIIT Kalkaji
NIIT Kalkaji
TA-109 Tughlakabad Extension, near Tara Apts.( opposite Khana Khazana), Tughlakabad Extension
New Delhi
011 4056 3000
CALL
DIRECTIONS.
Share:

Thursday, November 26, 2015

Questions on Collections in java

Questions on Collections in java

  1. TreeMap class is used to implement which collection interface. Select the one correct answer.
    1. Set
    2. SortedSet
    3. List
    4. Tree
    5. SortedMap
  2. Name the Collection interface implemented by the Vector class.
  3. Name the Collection interface implemented by the Hashtable class.
  4. Name the Collection interface implemented by the HashSet class.
  5. Which of these are interfaces in the collection framework. Select the two correct answers.
    1. Set
    2. List
    3. Array
    4. Vector
    5. LinkedList
  6. Which of these are interfaces in the collection framework. Select the two correct answers.
    1. HashMap
    2. ArrayList
    3. Collection
    4. SortedMap
    5. TreeMap
  7. What is the name of collection interface used to maintain non-unique elements in order.
  8. What is the name of collection interface used to maintain unique elements.
  9. What is the name of collection interface used to maintain mappings of keys to values.
  10. Is this true or false. Map interface is derived from the Collection interface.
    1. True
    2. False
Answers to questions on Collections
  1. e
  2. List
  3. Map
  4. Set
  5. a,b
  6. c,d
  7. List
  8. Set
  9. Map
  10. b
Share:

Mock Exam 2 for SCJP 6

Mock Exam 2 for SCJP 6

The mock exam is modeled on the Sun Certification for Java Programmer SCJP 6 exam. The exam has 29 questions. The real exam may be a little tougher than this. You need to score 58.33% correct answers to clear the real exam. Please let us know at ngabrani AT hotmail dot com if you find any issues with this exam. Some differences between this and the real exam are given below.
  1. The real exam will be tougher than this.
  2. The real exam will have 60 questions. This one has only 29
  3. The real exam would have more programmatic questions. Questions of the type - "what will happen when this code is compiled".

  1. Which of the following are Java keywords? Select the three correct answers.
    1. external
    2. implement
    3. throw
    4. void
    5. integer
    6. private
    7. synchronize
    8. unsigned

  2. Which of the following are legal definitions of the main method that can be used to execute a class. Select the one correct answer.
    1. public void main(String args)
    2. public static int main(String args[])
    3. public static void main(String args[])
    4. static public void MAIN(String args[])
    5. public static void main(string args[])
    6. public static void main(String *args)

  3. Which of these are legal array declarations or definitions? Select the two correct answers.
    1. int[] []x[];
    2. int *x;
    3. int x[5];
    4. int[] x = {1,2,3};

  4. Name the collection interface used to represent a sequence of numbers in a fixed order.


  5. The class Hashtable is used to implement which collection interface. Select the one correct answer.
    1. Table
    2. List
    3. Set
    4. SortedSet
    5. Map

  6. What gets printed when the following program is compiled and run? Select the one correct answer.

  7. 
    
    class test {
    
        public static void main(String args[]) {
    
            int i;
    
            do {
    
                i++;
    
            }
    
            while(i < 0);
    
            System.out.println(i);
    
        }
    
    }
    
    
    
    
    1. The program does not compile as i is not initialized.
    2. The program compiles but does not run.
    3. The program compiles and runs but does not print anything.
    4. The program prints 0.
    5. The program prints 1.


  8. What gets printed when the following program is compiled and run? Select the one correct answer.
    
    
    
    class xyz {
    
        static int i;
    
        public static void main(String args[]) {
    
    
    
            while (i < 0) {
    
                i--;
    
            }
    
            System.out.println(i);
    
        }
    
    }
    
    
    
    
    1. The program does not compile as i is not initialized.
    2. The program compiles but does not run.
    3. The program compiles and runs but does not print anything.
    4. The program prints 0.
    5. The program prints 1.

  9. What gets printed when the following program is compiled and run? Select the one correct answer.
  10. 
    
    
    class xyz {
    
     
    
        public static void main(String args[]) {
    
            int i,j,k;
    
            for (i = 0; i < 3; i++) {
    
                for(j=1; j < 4; j++) {
    
                    for(k=2; k<5; k++) {
    
                        if((i == j)   && (j==k))
    
                            System.out.println(i);
    
                    }                
    
                }
    
            }
    
        }
    
    }
    
    
    
    
    1. 0
    2. 1
    3. 2
    4. 3
    5. 4

  11. Using up to four characters what is the Java representation of the number 23 in hex?


  12. What gets printed when the following program is compiled and run? Select the one correct answer.
  13. 
    
    
    class test {
    
        static boolean check;
    
        public static void main(String args[]) {
    
            int i;
    
            if(check == true)
    
                i=1;
    
            else
    
                i=2;
    
    
    
            if(i=2) i=i+2;
    
            else i = i + 4;
    
            System.out.println(i);
    
         }
    
    }
    
    
    
    
    1. 3
    2. 4
    3. 5
    4. 6
    5. The program does not compile because of the statement if(i=2)

  14. Select the one correct answer. The smallest number that can be represented using short primitive type in Java is -
    1. 0
    2. -127
    3. -128
    4. -16384
    5. -32768
    6. The smallest number is compiler dependent.

  15. Given the following declarations, which of the assignments given in the options below would compile. Select the two correct answers.
    
    
    
    int i = 5;
    
    boolean t = true;
    
    float f = 2.3F;
    
    double d = 2.3;
    
    
    
    
    1. t = (boolean) i;
    2. f = d;
    3. d = i;
    4. i = 5;
    5. f = 2.8;

  16. What gets printed when the following program is compiled and run. Select the one correct answer.
    
    
    
    public class incr {
    
        public static void main(String args[]) {
    
            int i , j;
    
            i = j = 3;
    
            int n = 2 * ++i;
    
            int m = 2 * j++;
    
            System.out.println(i + " " + j + " " + n + " " + m);
    
        }
    
    }
    
    
    
    
    1. 4 4 8 6
    2. 4 4 8 8
    3. 4 4 6 6
    4. 4 3 8 6
    5. 4 3 8 8
    6. 4 4 6 8

  17. Given two non-negative integers a and b and a String str, what is the number of characters in the expression str.substring(a,b) . Select the one correct answer.
    1. a + b
    2. a - b
    3. b - a - 1
    4. b - a + 1
    5. b - a
    6. b

  18. What is the result of compiling and running the following program. Select the one correct answer.
    
    
    class test {
    
        public static void main(String args[]) {
    
            char ch;
    
            String test2 = "abcd";
    
            String test = new String("abcd");
    
            if(test.equals(test2)) {
    
                if(test == test2)
    
                    ch = test.charAt(0);
    
                else
    
                    ch = test.charAt(1);            
    
            }
    
            else {
    
                if(test == test2)
    
                    ch = test.charAt(2);
    
                else                
    
                    ch = test.charAt(3);
    
            }
    
            System.out.println(ch);
    
        }
    
    }
    
    
    
    
    1. 'a'
    2. 'b'
    3. 'c'
    4. 'd'
  19. What is the result of compiling and running the following program. Select the one correct answer.
    
    
    class test {
    
        public static void main(String args[]) {
    
         int i,j=0;
    
         for(i=10;i<0;i--) { j++; }
    
         switch(j) {
    
         case (0) :
    
             j=j+1;
    
         case(1):
    
             j=j+2;
    
             break;
    
         case (2) :
    
             j=j+3;
    
             break;
    
         
    
         case (10) :
    
             j=j+10;
    
             break;
    
         default :
    
             break;
    
         }
    
       System.out.println(j);
    
       }
    
    }
    
    
    
    
    1. 0
    2. 1
    3. 2
    4. 3
    5. 10
    6. 20
  20. What is the number displayed when the following program is compiled and run.
  21. 
    
    class test {
    
        public static void main(String args[]) {
    
            test test1 = new test();
    
                System.out.println(test1.xyz(100));    
    
        }
    
        public int xyz(int num) {
    
            if(num == 1) return 1;
    
            else return(xyz(num-1) + num);
    
        }
    
    }
    
    
    
    

  22. Which of the following statements are true. Select the one correct answer.
    1. Arrays in Java are essentially objects.
    2. It is not possible to assign one array to another. Individual elements of array can however be assigned.
    3. Array elements are indexed from 1 to size of array.
    4. If a method tries to access an array element beyond its range, a compile warning is generated.

  23. Which expression can be used to access the last element of an array. Select the one correct answer.
    1. array[array.length()]
    2. array[array.length() - 1]
    3. array[array.length]
    4. array[array.length - 1]

  24. What is the result of compiling and running the following program. Select the one correct answer.
  25. 
    
    class test {
    
        public static void main(String args[]) {
    
            int[] arr = {1,2,3,4};
    
            call_array(arr[0], arr);
    
            System.out.println(arr[0] + "," + arr[1]);        
    
        }
    
        static void call_array(int i, int arr[]) {
    
            arr[i] = 6;
    
            i = 5;
    
        }    
    
    }
    
    
    
    
    1. 1,2
    2. 5,2
    3. 1,6
    4. 5,6

  26. Which of the following statements are correct. Select the one correct answer.
    1. Each Java file must have exactly one package statement to specify where the class is stored.
    2. If a Java file has both import and package statement, the import statement must come before package statement.
    3. A Java file has at least one class defined.
    4. If a Java file has a package statement, it must be the first statement (except comments).

  27. What happens when the following program is compiled and then the command "java check it out" is executed. Select the one correct answer.
  28. 
    
    class check {
    
        public static void main(String args[]) {
    
            System.out.println(args[args.length-2]);
    
        }
    
    }
    
    
    
    
    1. The program does not compile.
    2. The program compiles but generates ArrayIndexOutOfBoundsException exception.
    3. The program prints java
    4. The program prints check
    5. The program prints it
    6. The program prints out

  29. What all gets printed when the following code is compiled and run. Select the three correct answers.
  30. 
    
    class test {
    
        public static void main(String args[]) {
    
            int i[] = {0,1};
    
            try {
    
                i[2] = i[0] + i[1];
    
            }
    
            catch(ArrayIndexOutOfBoundsException e1) {
    
                System.out.println("1");
    
            }
    
            catch(Exception e2) {
    
                System.out.println("2");
    
            }
    
            finally {
    
                System.out.println(3);
    
            }
    
            System.out.println("4");  
    
         }
    
    }
    
    
    
    
    1. 1
    2. 2
    3. 3
    4. 4

  31. A program needs to store the name, salary, and age of employees in years. Which of the following data types should be used to create the Employee class. Select the three correct answers.
    1. char
    2. boolean
    3. Boolean
    4. String
    5. int
    6. double

  32. To make a variable defined in a class accessible only to methods defined in the classes in same package, which of the following keyword should be used. Select the one correct answer.
    1. By using the keyword package before the variable.
    2. By using the keyword private before the variable.
    3. By using the keyword protected before the variable.
    4. By using the keyword public before the variable.
    5. The variable should not be preceded by any of the above mentioned keywords.

  33. In implementing two classes Employee and Manager, such that each Manager is an Employee, what should be the relationship between these classes. Select the one correct answer.
    1. Employee should be the base class of Manager class.
    2. Manager should be the base class of Employee class.
    3. Manager class should include the Employee class as a data member.
    4. Employee class should include Manager class as a data member.
    5. The Manager and Employee should not have any relationship.

  34. Select the one most appropriate answer. What is the purpose of method parseInt defined in Integer class.
    1. The method converts an integer to a String.
    2. The method is used to convert String to an integer, assuming that the String represents an integer.
    3. The method is used to convert String to Integer class, assuming that the String represents an integer.
    4. The method converts the Integer object to a String.

  35. What should be done to invoke the run() method on a thread for an object derived from the Thread class. Select the one correct answer.
    1. The run() method should be directly invoked on the Object.
    2. The start() method should be directly invoked on the Object.
    3. The init() method should be directly invoked on the Object.
    4. The creation of the object using the new operator would create a new thread and invoke its run() method.

  36. What is the default priority of a newly created thread.
    1. MIN_PRIORITY (which is defined as 1 in the Thread class.)
    2. NORM_PRIORITY (which is defined as 5 in the Thread class.)
    3. MAX_PRIORITY (which is defined as 10 in the Thread class.)
    4. A thread inherits the priority of its parent thread.

Answers to Sample Test 2 
  1. c, d, f
  2. c. The main method must be static and return void. Hence a and b are incorrect. It must take an array of String as argument. Hence e and f are incorrect. As Java is case sensitive, d is incorrect.
  3. a, d
  4. List
  5. e. The collection interface Map has two implementation HashMap and Hashtable.
  6. a. Local variables are not initialized by default. They must be initialized before they are used.
  7. d. The variable i gets initialized to zero. The while loop does not get executed.
  8. c. During various iterations of three loops, the only time i, j and k have same values are when all of them are set to 2.
  9. 0x17 or 0X17.
  10. e. The statement "i=2" evaluates to 2. The expression within the if block must evaluate to a boolean.
  11. e. The range of short primitive type is -32768 to 32767.
  12. c,d. Java does not allow casts between boolean values and any numeric types. Hence a is incorrect. Assigning double to a float requires an explicit cast. Hence b and e are incorrect.
  13. a
  14. e
  15. b. Both Strings test and test2 contain "abcd" . They are however located at different memory addresses. Hence test == test2 returns false, and test.equals(test2) returns true.
  16. d. The for loop does not get executed even once as the condition (i < 0) fails in the first iteration. In the switch statement, the statement j = j +1; gets executed, setting j to 1. As there is no break after this case, the next statement also gets executed setting j to 3.
  17. 5050. The recursive function xyz essentially sums up numbers 1 to num. This evaluates to (num * (num + 1))/2.
  18. a. Java supports assignment of one array to another. Hence b is incorrect. Array elements are indexed from 0. Hence c is incorrect. A method that accesses array elements out of its range does not generate a compilation error. Hence d is incorrect.
  19. d. array.length gives the number of elements in the array. As indexes in Java start from 0, d is the correct answer.
  20. c. In the invocation of call_array, the first element is invoked using call-by-value, and the second using call-by-reference.
  21. d. import statement, package statement and class definitions are all optional in a file. Hence a and c are incorrect. If both import and package statements are present in a file, then package statement must appear before the import statement. Hence b is incorrect.
  22. e. The args array consists of two elements "it" and "out". args.length is set to two.
  23. a,c,d. The exception ArrayIndexOutOfBoundsException is generated as the main method tries to access i[2]. Hence 1 gets printed. After this finally block gets excuted, before the program exits.
  24. d,e,f
  25. e. A data member that does not have public/protected/private is accessible to all methods in the same package.
  26. a. The Manager and Employee share as "is a" relationship - A Manager is an Employee. This is captured by making Employee the base class of Manager.
  27. b. The method int parseInt(Sting s) returns the integer value corresponding to input String, assuming that the input string represents an integer in base 10.
  28. b. The start() method invokes the run() method when the thread is ready to execute.
  29. d
Share:

Mock exam 1 for SCJP 6

Mock exam 1 for SCJP 6

The sample test is modeled on the Sun Certification for JavaTM 6 Programmer exam. The test has 50 questions and needs to be executed in 2 hours. The real exam may be a little tougher than this. You need to score 35 correct answers out of 60 to clear the real exam in 180 minutes. Please let us know at ngabrani At hotmail dot com if you find any issues with the test. The site also offers another mock exam and questions by topic.
  1. Which declaration of the main method below would allow a class to be started as a standalone program. Select the one correct answer.
    1. public static int main(char args[])
    2. public static void main(String args[])
    3. public static void MAIN(String args[])
    4. public static void main(String args)
    5. public static void main(char args[])
  2. What all gets printed when the following code is compiled and run? Select the three correct answers.
  3. 
    public class xyz {
       public static void main(String args[]) {
          for(int i = 0; i < 2; i++) {
             for(int j = 2; j>= 0; j--) {
                if(i == j) break;
                System.out.println("i=" + i + " j="+j);
             }
          }
       }
    }
    
    
    1. i=0 j=0
    2. i=0 j=1
    3. i=0 j=2
    4. i=1 j=0
    5. i=1 j=1
    6. i=1 j=2
    7. i=2 j=0
    8. i=2 j=1
    9. i=2 j=2
  4. What gets printed when the following code is compiled and run with the following command -
    java test 2
    Select the one correct answer.
  5. 
    public class test {
       public static void main(String args[]) { 
          Integer intObj=Integer.valueOf(args[args.length-1]);
          int i = intObj.intValue();
    
          if(args.length > 1) 
             System.out.println(i);
          if(args.length > 0)
             System.out.println(i - 1);
          else 
             System.out.println(i - 2);
       }
    }
            
    
    
    1. test
    2. test -1
    3. 0
    4. 1
    5. 2
  6. In Java technology what expression can be used to represent number of elements in an array named arr ?
  7. How would the number 5 be represented in hex using up-to four characters.
  8. Which of the following is a Java keyword. Select the four correct answers.
    1. extern
    2. synchronized
    3. volatile
    4. friend
    5. friendly
    6. transient
    7. this
    8. then
  9. Is the following statement true or false. The constructor of a class must not have a return type.
    1. true
    2. false
  10. What is the number of bytes used by Java primitive long. Select the one correct answer.
    1. The number of bytes is compiler dependent.
    2. 2
    3. 4
    4. 8
    5. 64
  11. What is returned when the method substring(2, 4) is invoked on the string "example"? Include the answer in quotes as the result is of type String.
  12. Which of the following is correct? Select the two correct answers.
    1. The native keyword indicates that the method is implemented in another language like C/C++.
    2. The only statements that can appear before an import statement in a Java file are comments.
    3. The method definitions inside interfaces are public and abstract. They cannot be private or protected.
    4. A class constructor may have public or protected keyword before them, nothing else.
  13. What is the result of evaluating the expression 14 ^ 23. Select the one correct answer.
    1. 25
    2. 37
    3. 6
    4. 31
    5. 17
    6. 9
    7. 24
  14. Which of the following are true. Select the one correct answers.
    1. && operator is used for short-circuited logical AND.
    2. ~ operator is the bit-wise XOR operator.
    3. | operator is used to perform bitwise OR and also short-circuited logical OR.
    4. The unsigned right shift operator in Java is >>.
  15. Name the access modifier which when used with a method, makes it available to all the classes in the same package and to all the subclasses of the class.
  16. Which of the following is true. Select the two correct answers.
    1. A class that is abstract may not be instantiated.
    2. The final keyword indicates that the body of a method is to be found elsewhere. The code is written in non-Java language, typically in C/C++.
    3. A static variable indicates there is only one copy of that variable.
    4. A method defined as private indicates that it is accessible to all other classes in the same package.
  17. What all gets printed when the following program is compiled and run. Select the two correct answers.

  18. 
    public class test {
       public static void main(String args[]) { 
          int i, j=1;
          i = (j>1)?2:1;
          switch(i) {
            case 0: System.out.println(0); break;
            case 1: System.out.println(1);
            case 2: System.out.println(2); break;
            case 3: System.out.println(3); break;
          }
       }
    }
            
    
    
    1. 0
    2. 1
    3. 2
    4. 3




  19. What all gets printed when the following program is compiled and run. Select the one correct answer.
  20. 
    public class test {
       public static void main(String args[]) { 
          int i=0, j=2;
          do {
             i=++i;
             j--;
          } while(j>0);
          System.out.println(i);
       }
    }
            
    
    
    1. 0
    2. 1
    3. 2
    4. The program does not compile because of statement "i=++i;"
  21. What all gets printed when the following gets compiled and run. Select the three correct answers.
    
    public class test {
        public static void main(String args[]) { 
            int i=1, j=1;
            try {
                i++; 
                j--;
                if(i/j > 1)
                    i++;
            }
            catch(ArithmeticException e) {
                System.out.println(0);
            }
            catch(ArrayIndexOutOfBoundsException e) {
                System.out.println(1);
            }
            catch(Exception e) {
                System.out.println(2);
            }
            finally {
                System.out.println(3);
            }
            System.out.println(4);
         }
    }
            
    
    
    1. 0
    2. 1
    3. 2
    4. 3
    5. 4
  22. What all gets printed when the following gets compiled and run. Select the two correct answers.

  23. 
    public class test {
        public static void main(String args[]) { 
            int i=1, j=1;
            try {
                i++; 
                j--;
                if(i == j)
                    i++;
            }
            catch(ArithmeticException e) {
                System.out.println(0);
            }
            catch(ArrayIndexOutOfBoundsException e) {
                System.out.println(1);
            }
            catch(Exception e) {
                System.out.println(2);
            }
            finally {
                System.out.println(3);
            }
            System.out.println(4);
         }
    }
            
    
    
    1. 0
    2. 1
    3. 2
    4. 3
    5. 4
  24. What all gets printed when the following gets compiled and run. Select the two correct answers.

  25. 
    public class test {
        public static void main(String args[]) { 
        String s1 = "abc";
        String s2 = "abc";
        if(s1 == s2)
            System.out.println(1);
        else
            System.out.println(2);
        if(s1.equals(s2))
            System.out.println(3);
        else
            System.out.println(4);
        }
    }
            
    
    
    1. 1
    2. 2
    3. 3
    4. 4
  26. What all gets printed when the following gets compiled and run. Select the two correct answers.

  27. 
    public class test {
        public static void main(String args[]) { 
        String s1 = "abc";
        String s2 = new String("abc");
    
        if(s1 == s2)
            System.out.println(1);
        else
            System.out.println(2);
        if(s1.equals(s2))
            System.out.println(3);
        else
            System.out.println(4);
        }
    }
            
    
    
    1. 1
    2. 2
    3. 3
    4. 4
  28. Which of the following are legal array declarations. Select the three correct answers.
    1. int i[5][];
    2. int i[][];
    3. int []i[];
    4. int i[5][5];
    5. int[][] a;
  29. What is the range of values that can be specified for an int. Select the one correct answer.
    1. The range of values is compiler dependent.
    2. -231 to 231 - 1
    3. -231-1 to 231
    4. -215 to 215 - 1
    5. -215-1 to 215
  30. How can you ensure that the memory allocated by an object is freed. Select the one correct answer.
    1. By invoking the free method on the object.
    2. By calling system.gc() method.
    3. By setting all references to the object to new values (say null).
    4. Garbage collection cannot be forced. The programmer cannot force the JVM to free the memory used by an object.
  31. What gets printed when the following code is compiled and run. Select the one correct answer.

  32. 
    public class test {
        public static void main(String args[]) { 
        int i = 1;
        do {
            i--;
        } while (i > 2);
        System.out.println(i);
        }
    }
            
    
    
    1. 0
    2. 1
    3. 2
    4. -1
  33. Which of these is a legal definition of a method named m assuming it throws IOException, and returns void. Also assume that the method does not take any arguments. Select the one correct answer.
    1. void m() throws IOException{}
    2. void m() throw IOException{}
    3. void m(void) throws IOException{}
    4. m() throws IOException{}
    5. void m() {} throws IOException
  34. Which of the following are legal identifier names in Java. Select the two correct answers.
    1. %abcd
    2. $abcd
    3. 1abcd
    4. package
    5. _a_long_name
  35. At what stage in the following method does the object initially referenced by s becomes available for garbage collection. Select the one correct answer.

  36. 
    void method X()  { 
        String r = new String("abc");
        String s = new String("abc");
        r = r+1; //1
        r = null; //2
        s = s + r; //3
    } //4
            
    
    
    1. Before statement labeled 1
    2. Before statement labeled 2
    3. Before statement labeled 3
    4. Before statement labeled 4
    5. Never.
  37. String s = new String("xyz"); 
    Assuming the above declaration, which of the following statements would compile. Select the one correct answer.
    1. s = 2 * s;
    2. int i = s[0];
    3. s = s + s;
    4. s = s >> 2;
    5. None of the above.
  38. Which of the following statements related to Garbage Collection are correct. Select the two correct answers.
    1. It is possible for a program to free memory at a given time.
    2. Garbage Collection feature of Java ensures that the program never runs out of memory.
    3. It is possible for a program to make an object available for Garbage Collection.
    4. The finalize method of an object is invoked before garbage collection is performed on the object.
  39. If a base class has a method defined as
    void method() { }
    Which of the following are legal prototypes in a derived class of this class. Select the two correct answers.
    1. void method() { }
    2. int method() { return 0;}
    3. void method(int i) { }
    4. private void method() { }
  40. In which all cases does an exception gets generated. Select the two correct answers.

  41. int i = 0, j = 1; 
    1. if((i == 0) || (j/i == 1))
    2. if((i == 0) | (j/i == 1))
    3. if((i != 0) && (j/i == 1))
    4. if((i != 0) & (j/i == 1))
  42. Which of the following statements are true. Select the two correct answers.
    1. The wait method defined in the Thread class, can be used to convert a thread from Running state to Waiting state.
    2. The wait(), notify(), and notifyAll() methods must be executed in synchronized code.
    3. The notify() and notifyAll() methods can be used to signal and move waiting threads to ready-to-run state.
    4. The Thread class is an abstract class.
  43. Which keyword when applied on a method indicates that only one thread should execute the method at a time. Select the one correct answer.
    1. transient
    2. volatile
    3. synchronized
    4. native
    5. static
    6. final
  44. What is the name of the Collection interface used to represent elements in a sequence (in a particular order). Select the one correct answer.
    1. Collection
    2. Set
    3. List
    4. Map
  45. Which of these classes implement the Collection interface SortedMap. Select the one correct answers.
    1. HashMap
    2. Hashtable
    3. TreeMap
    4. HashSet
    5. TreeSet
    6. Vector
  46. Which of the following are true about interfaces. Select the two correct answers.
    1. Methods declared in interfaces are implicitly private.
    2. Variables declared in interfaces are implicitly public, static, and final.
    3. An interface can extend any number of interfaces.
    4. The keyword implements indicate that an interface inherits from another.
  47. Assume that class A extends class B, which extends class C. Also all the three classes implement the method test(). How can a method in a class A invoke the test() method defined in class C (without creating a new instance of class C). Select the one correct answer.
    1. test();
    2. super.test();
    3. super.super.test();
    4. ::test();
    5. C.test();
    6. It is not possible to invoke test() method defined in C from a method in A.
  48. What is the return type of method round(double d) defined in Math class.
  49. What gets written on the screen when the following program is compiled and run. Select the one right answer.
  50. 
    public class test {
       public static void main(String args[]) { 
       int i;
       float  f = 2.3f;
       double d = 2.7;
       i = ((int)Math.ceil(f)) * ((int)Math.round(d));
     
       System.out.println(i);
       }
    }
    
    
    1. 4
    2. 5
    3. 6
    4. 6.1
    5. 9
  51. Is the following statement true or false. As the toString method is defined in the Object class, System.out.println can be used to print any object.
    1. true
    2. false
  52. Which of these classes defined in java.io and used for file-handling are abstract. Select the two correct answers.
    1. InputStream
    2. PrintStream
    3. Reader
    4. FileInputStream
    5. FileWriter
  53. Name the collection interface used to represent collections that maintain unique elements.
  54. What is the result of compiling and running the following program.
  55. 
    public class test {
       public static void main(String args[]) { 
          String str1="abc";
          String str2="def";
          String str3=str1.concat(str2);
    
          str1.concat(str2);
          System.out.println(str1);
       }
    }
    
    
    1. abc
    2. def
    3. abcabc
    4. abcdef
    5. defabc
    6. abcdefdef
  56. Select the one correct answer. The number of characters in an object of a class String is given by
    1. The member variable called size
    2. The member variable called length
    3. The method size() returns the number of characters.
    4. The method length() returns the number of characters.
  57. Select the one correct answer. Which method defined in Integer class can be used to convert an Integer object to primitive int type.
    1. valueOf
    2. intValue
    3. getInt
    4. getInteger
  58. Name the return type of method hashCode() defined in Object class, which is used to get the unique hash value of an Object.
  59. Which of the following are correct. Select the one correct answer.
    1. An import statement, if defined, must always be the first non-comment statement of the file.
    2. private members are accessible to all classes in the same package.
    3. An abstract class can be declared as final.
    4. Local variables cannot be declared as static.
  60. Name the keyword that makes a variable belong to a class, rather than being defined for each instance of the class. Select the one correct answer.
    1. static
    2. final
    3. abstract
    4. native
    5. volatile
    6. transient
  61. Which of these are core interfaces in the collection framework. Select the one correct answer.
    1. Tree
    2. Stack
    3. Queue
    4. Array
    5. LinkedList
    6. Map
  62. Which of these statements are true. Select the two correct answers.
    1. For each try block there must be at least one catch block defined.
    2. A try block may be followed by any number of finally blocks.
    3. A try block must be followed by at least one finally or catch block.
    4. If both catch and finally blocks are defined, catch block must precede the finally block.
ANSWERs-------
Answers to Sample Test 1 
  1. b
  2. b, c, f
  3. d. Note that the program gets one command line argument - 2. args.length will get set to 1. So the condition if(args.length > 1) will fail, and the second check if(args.length > 0) will return true.
  4. arr.length
  5. Any of these is correct - 0x5, 0x05, 0X05, 0X5
  6. b, c, f, g
  7. a
  8. d
  9. "am"
  10. a, c. Please note that b is not correct. A package statement may appear before an import statement. A class constructor may be declared private also. Hence d is incorrect.
  11. a
  12. a
  13. protected
  14. a, c
  15. b, c
  16. c
  17. a, d, e
  18. d, e
  19. a, c
  20. b, c
  21. b, c, e
  22. b
  23. d
  24. a
  25. a
  26. b, e . The option c is incorrect because a Java identifier name cannot begin with a digit.
  27. d
  28. c
  29. c, d
  30. a, c
  31. b, d
  32. b, c
  33. c
  34. c
  35. c
  36. b, c
  37. f
  38. long
  39. e
  40. a
  41. a, c
  42. Set
  43. a
  44. d
  45. b
  46. int
  47. d
  48. a
  49. f
  50. c, d

Share:
GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

Unordered List