Java Certifications
www.javacertifications.com
 home  scjp1.5  scjp1.6  scwcd 1.5  scjp 1.5 questions  scjp 1.6 questions  scwcd 1.5 questions  scjp 1.5 success kit  scjp 1.6 success kit  
  JavaCertifications.net provides java certfication tutorials and mock questions.  


Bookmark and Share |||     Share   
805 scjp 1.6 questions with explanations ||| 788 scjp 1.5 questions with explanations ||| 650 SCWCD 5.0 questions with explanations

Mock Questions

  scjp 1.5

  • Declarations, Initialization & Scoping
  • Method overriding or overloading
  • Inner Classes
  • Flow Control
  • Type Safe Enum
  • Enhanced for loop
  • Assertions
  • Exception
  • API Contents autoboxing & unboxing
  • File
  • Serializable
  • java.text and Locale
  • Regular Expression
  • Collections and Generics
  • Thread and Concurrency

  •   scjp 1.6

  • Declarations, Initialization & Scoping
  • Method overriding or overloading
  • Inner Classes
  • Flow Control
  • Type Safe Enum
  • Enhanced for loop
  • Assertions
  • Exception
  • API Contents autoboxing & unboxing
  • File
  • Serializable
  • java.text and Locale
  • Regular Expression
  • Collections and Generics
  • Thread and Concurrency
  • NavigableMap
  • NavigableSet
  • java.io.Console

  •   scwcd 1.5

  • Servlet Basic
  • The Structure and Deployment of Web Applications
  • The Web Container Model
  • Servlet event listeners
  • Session Management,session listeners
  • Servlet Filter
  • Web Application Security
  • j2ee patterns
  • JSP Directives
  • JSP page life cycle
  • JSP implicit objects
  • JSP include
  • Expression Language (EL)
  • JSTL
  • Building a Custom Tag Library
  • SCJP : NavigableSet Mock Exam Practice Questions

    Questions no -1 
    What is the output for the below code ?
    
    public class Test {
    	public static void main(String... args) {
            
    		
    		 List lst = new ArrayList();
    		 lst.add(34);
    		 lst.add(6);
    		 lst.add(6);
    		 lst.add(6);
    		 lst.add(6);
    		 lst.add(5);
    		         
    	        NavigableSet  nvset = new TreeSet(lst);
    	        System.out.println(nvset.tailSet(6));
    	     	      
    	}
    }
    
    
    
    options A)Compile error : No method name like tailSet() B)6 34 C)5 D)5 6 34 Correct answer is : B Explanations : tailSet(6) Returns elements are greater than or equal to 6.
    Questions no -2 
    What is the output for the below code ?
    
    import java.util.ArrayList;
    import java.util.List;
    import java.util.NavigableSet;
    import java.util.TreeSet;
    
    
    
    
    public class Test {
    	public static void main(String... args) {
            
    		
    		List lst = new ArrayList();
    		 lst.add(34);
    		 lst.add(6);
    		 lst.add(6);
    		 lst.add(6);
    		 lst.add(6);
    		         
    	        NavigableSet  nvset = new TreeSet(lst);
    	        nvset.pollFirst(); 
    	        nvset.pollLast();
                System.out.println(nvset.size());
    
    
    	     	      
    	}
    }
    
    
    
    options A)Compile error : No method name like pollFirst() or pollLast() B)0 C)3 D)5 Correct answer is : B Explanations :
  • pollFirst() Retrieves and removes the first (lowest) element, or returns null if this set is empty.
  • pollLast() Retrieves and removes the last (highest) element, or returns null if this set is empty.
  • Questions no -3
    What is the output for the below code ?
    
    import java.util.ArrayList;
    import java.util.List;
    import java.util.NavigableSet;
    import java.util.TreeSet;
    
    
    public class Test {
    	public static void main(String... args) {
            
    		
    		 List lst = new ArrayList();
    		 lst.add(34);
    		 lst.add(6);
    		 lst.add(2);
    		 lst.add(8);
    	     lst.add(7);
    	     lst.add(10);
    	        
    	        NavigableSet  nvset = new TreeSet(lst);
    	        System.out.println(nvset.lower(6)+" "+nvset.higher(6)+ " "+ nvset.lower(2));
    	      
    	}
    }
    
    
    options A)1 2 7 10 34 null B)2 7 null C)2 7 34 D)1 2 7 10 34 Correct answer is : B Explanations :
  • lower() Returns the greatest element in this set strictly less than the given element, or null if there is no such element.
  • higher() Returns the least element in this set strictly greater than the given element, or null if there is no such element.
  • Questions no -4
    What is the output for the below code ?
    
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.util.NavigableSet;
    import java.util.TreeSet;
    
    
    public class Test {
    	public static void main(String... args) {
            
    		
    		 List lst = new ArrayList();
    		 lst.add(34);
    		 lst.add(6);
    		 lst.add(2);
    		 lst.add(8);
    	     lst.add(7);
    	     lst.add(10);
    	        
    	        NavigableSet  nvset = new TreeSet(lst);
    	         System.out.println(nvset.headSet(10));
    
    	      
    	}
    }
    
    
    
    options A)Compile error : No method name like headSet() B)2, 6, 7, 8, 10 C)2, 6, 7, 8 D)34 Correct answer is : C Explanations :
  • headSet(10) Returns the elements elements are strictly less than 10.
  • headSet(10,false) Returns the elements elements are strictly less than 10.
  • headSet(10,true) Returns the elements elements are strictly less than or equal to 10.
  • scjp 1.5 | scjp 1.6 | scwcd 1.5
    Java Certifications
    www.javacertifications.net