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 : NavigableMap Mock Exam Practice Questions

    Questions no -1 
    What is the output for the below code ?
    
    import java.util.NavigableMap;
    import java.util.concurrent.ConcurrentSkipListMap;
    
    
    public class Test {
    	public static void main(String... args) {
            
    		
    		NavigableMap navMap = new 
            ConcurrentSkipListMap();
    		
    		navMap.put(4, "April");
    		navMap.put(5, "May");
    		navMap.put(6, "June");
    		navMap.put(1, "January");
    		navMap.put(2, "February");
    		navMap.put(3, "March");
    
            navMap.pollFirstEntry();
            navMap.pollLastEntry();
            navMap.pollFirstEntry();
            System.out.println(navMap.size());
    
    
    	     	      
    	}
    }
    
    
    
    options A)Compile error : No method name like pollFirstEntry() or pollLastEntry() B)3 C)6 D)4 Correct answer is : B Explanations :
  • pollFirstEntry() Removes and returns a key-value mapping associated with the least key in this map, or null if the map is empty.
  • pollLastEntry() Removes and returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.
  • Questions no -2
    What is the output for the below code ?
    
    import java.util.NavigableMap;
    import java.util.concurrent.ConcurrentSkipListMap;
    
    
    public class Test {
    	public static void main(String... args) {
            
    		
    		NavigableMap navMap = new 
            ConcurrentSkipListMap();
    	
            System.out.print(navMap.lastEntry());
    
    
    	     	      
    	}
    }
    
    
    options A)Compile error : No method name like lastEntry() B)null C)NullPointerException D)0 Correct answer is : B Explanations : lastEntry() Returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.
    Questions no -3
    What is the output for the below code ?
    
    import java.util.NavigableMap;
    import java.util.concurrent.ConcurrentSkipListMap;
    
    public class Test {
    	public static void main(String... args) {
            
    		
    		NavigableMapnavMap = new 
            ConcurrentSkipListMap();
    		
    		navMap.put(4, "April");
    		navMap.put(5, "May");
    		navMap.put(6, "June");
    		navMap.put(1, "January");
    		navMap.put(2, "February");
    	
    
            System.out.print(navMap.ceilingKey(3));
            
    
    
    	     	      
    	}
    }
    
    
    options A)Compile error : No method name like ceilingKey() B)null C)NullPointerException D)4 Correct answer is : D Explanations : Returns the least key greater than or equal to the given key, or null if there is no such key. In the above case : 3 is not a key so return 4 (least key greater than or equal to the given key).
    Questions no -4
    What is the output for the below code ?
    
    import java.util.NavigableMap;
    import java.util.concurrent.ConcurrentSkipListMap;
    
    public class Test {
    	public static void main(String... args) {
            
    		
    		NavigableMapnavMap = new 
            ConcurrentSkipListMap();
    		
    		navMap.put(4, "April");
    		navMap.put(5, "May");
    		navMap.put(6, "June");
    		navMap.put(1, "January");
    		navMap.put(2, "February");
    	
    
            System.out.print(navMap.floorKey(3));
            
    
    
    	     	      
    	}
    }
    
    options A)Compile error : No method name like floorKey() B)null C)NullPointerException D)2 Correct answer is : D Explanations : Returns the greatest key less than or equal to the given key, or null if there is no such key. In the above case : 3 is not a key so return 2 (greatest key less than or equal to the given key).
    scjp 1.5 | scjp 1.6 | scwcd 1.5
    Java Certifications
    www.javacertifications.net