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

    Questions no -1 
    What is the output for the below code ?
    
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    
    public class Test {
    	
    	public static void main(String... args) {
                
    		Pattern p = Pattern.compile("a*b");
    		Matcher m = p.matcher("b");
    		boolean b = m.matches();
    		System.out.println(b);
    
    		
    
    	}
    }
    
    
    
    options A)true B)Compile Error C)false D)b Correct answer is : A Explanations : a*b means "a" may present zero or more time and "b" should be present once.
    Questions no -2 
    What is the output for the below code ?
    
    public class Test {
    	
    	public static void main(String... args) {
                
    		
    		String input = "1 fish 2 fish red fish blue fish";
    		Scanner s = new Scanner(input).useDelimiter("\\s*fish\\s*");
    		System.out.println(s.nextInt());
    		System.out.println(s.nextInt());
    		System.out.println(s.next());
    		System.out.println(s.next());
    		s.close(); 
    		
    
    	}
    }
    
    
    
    options A)1 2 red blue B)Compile Error - because Scanner is not defind in java. C)1 fish 2 fish red fish blue fish D)1 fish 2 fish red blue fish Correct answer is : A Explanations : java.util.Scanner is a simple text scanner which can parse primitive types and strings using regular expressions.
    Questions no -3 
    What is the output for the below code ?
    
    public class Test {
    	
    	public static void main(String... args) {
                
    		Pattern p = Pattern.compile("a{3}b?c*");
    		Matcher m = p.matcher("aaab");
    		boolean b = m.matches();
    		System.out.println(b);
    
    		
    
    	}
    }
    
    
    
    options A)true B)Compile Error C)false D)NullPointerException Correct answer is : A Explanations : X? X, once or not at all X* X, zero or more times X+ X, one or more times X{n} X, exactly n times X{n,} X, at least n times X{n,m} X, at least n but not more than m times
    Questions no -4 
    What is the output for the below code ?
    
    public class Test {
    	
    	public static void main(String... args) {
                
    		Pattern p = Pattern.compile("a{1,3}b?c*");
    		Matcher m = p.matcher("aaab");
    		boolean b = m.matches();
    		System.out.println(b);
    
    		
    
    	}
    }
    
    
    
    options A)true B)Compile Error C)false D)NullPointerException Correct answer is : A Explanations : X? X, once or not at all X* X, zero or more times X+ X, one or more times X{n} X, exactly n times X{n,} X, at least n times X{n,m} X, at least n but not more than m times
    scjp 1.5 | scjp 1.6 | scwcd 1.5
    Java Certifications
    www.javacertifications.net