FileStore in Java 7

java-thumbnail

FileStore is new class introduced in Java 7.0. It is part of java.nio package. This class helps in geting the type of storage for the files stored whether it’s a device, partition or concreate file system. Also this class defines the list of methods which is useful for getting information about the file storage such […]

OCPJP 6 Mock Exam – 21

ocpjp-6-thumbnail

1 . Given: Which two construct an anonymous inner class? Choose the two below: AnAdapter1 aa = new AnAdapter1 () {} AnAdapter0 aa = new AnAdapter0 () {} AnAdapter0 aa = new AnAdapter0 (5) {} AnAdapter1 aa = new AnAdapter1 (5) {} AnInterface ai = new Anlnterface (5)) { 2 . What will be the […]

OCPJP 6 Mock Exam – 20

ocpjp-6-thumbnail

1 . Which of the following are valid array construction? int a[] = new int[]; int a[] = new int[10]; int a[10] = new int[]; int a[] = new a[10]; 2 . Which of the following are valid array initialization? new int[] = {1,2,3,4}; new int[10] = {1,2,3,4}; new int[] = 1,2,3,4; new int[] = […]

How To Convert String To Byte In Java?

java-thumbnail

This tutorial highlights the simple example to demonstrates how to convert a string object to the byte stream. We can simply use the getBytes() method in the string object to convert the string to bytes array. Lets look at the example program. Output

How To Convert Char To String In Java?

java-thumbnail

This post highlights a simple example to demonstrates how to convert a char datatype to a string object. Lets look at the example program. Output

How To Debug JSP Page?

java-ee-thumbnail

Java EE Tutorials JSP Tutorials Recommended Books for Java Server Pages (JSP) Debugging enables a developer to detect and identifies the errors in the application. But testing a JSP/Servlet compared to other programs is often found to be difficult. Following are some of the suggestions which can be used to test you JSP programs: Using […]

OCPJP 6 Mock Exam -19

ocpjp-6-thumbnail

1 . What will be the output? Choose the one below: 10 0 Nothing is printed Compiler error 2 . which of the following modifiers are applied to the nested classes class? private protected public static All the above 3 . which of the following modifiers are applied to the top level classes? static private […]

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…