OCPJP 6 Mock Exam -18

ocpjp-6-thumbnail

1 . What will be the output? Choose the one below: Base(){} Base(long l){} Base(float f){} It will compile properly 2 . What will be the output? Choose the one below: 2 4 Compiler Error It will compile if we add super(2) in Test2() 3 . which of the following keywords can be applied to […]

OCPJP 6 Mock Exam -17

ocpjp-6-thumbnail

1 . Given: Which of the following constructor signatures MUST exist in the Demo class for Derived to compile correctly? public Demo(int a, int b) public Demo(int c) public Demo() 2 . Which of the following class declarations for a normal top level class are incorrect? public synchronized class Base extends Thread private protected class […]

How To Convert String To Char Array In Java?

java-thumbnail

This tutorial is simple example for converting a string object into a simple character array. Lets look at the example. Output…  

How To Convert Char Array To String In Java?

java-thumbnail

This tutorial is simple example for converting a character array into a simple string object. In general, there are two ways to convert the character array to string object, First approach is to pass the array into the string constructor and second approach is to using the String.valueOf(). Lets look at the example. Output…

StringTokenizer Example

java-thumbnail

StringTokenizer in java.util package is very useful for spliting the length string into the pieces. You can pass a delimeter to the StringTokenizer constructor to split the string where ever that delimeter appeared in the string. If you have not passed any delimeter, by default it splits the string using the empty space in the […]

Compressing and Uncompressing File Example in Java

java-thumbnail

Compressing and Uncompressing of the files is one of the common utility we use in our daily life. If you are using windows, using WinZip is very common to compress the files and sent to others. The advantage of compressing the files is to save the memory occupied for the file in the disk. It […]

Auto Refresh a Web Page In JSP

java-ee-thumbnail

Java EE Tutorials JSP Tutorials Recommended Books for Java Server Pages (JSP) Instead of refreshing the web page all the time, JSP includes such a code in which refreshing is done automatically in the web page. setIntHeader method of response object (HttpServletResponse) can be used for refreshing the page. Signature of this method setIntHeader is […]

Apache Tomcat 8 Features

tomcat-thumbnail

If you are a Java web developer, it is most likely that you are aware of the popularity of Tomcat web server. Tomcat is the Reference Implementation (RI) for the JSP and Servlets specification from the beginning. Not only that, many of the application servers internally using the Tomcat as their web server since it […]

OCPJP 6 Mock Exam -16

ocpjp-6-thumbnail

1 . What will be the output? Choose the one below: Compile time error at line 10 Compilation and output of 123 Compilation and output of the digits “1”, “2” and “3”, but the order can’t be determined Compilation and output of onetwothree Compilation but runtime error at line 10 2 . The following is […]

How To Use JavaBeans in JSP?

java-ee-thumbnail

Java EE Tutorials JSP Tutorials Recommended Books for Java Server Pages (JSP) JavaBeans are simple classes that are used to develop dynamic WebPages. JavaBeans are required to create dynamic web pages by using separate java classes instead of using java code in a JSP page. It provides getter and setter methods to get and set values […]