Saturday 30 June 2018

FAQs for Java Certification



Over the years the need of global certification is increasingly in demand.You may be fresher or experienced, the global certification is certainly a way to take ahead your IT career. Out of many platforms, 
Oracle's Java platform is one of the most broadly accepted platforms in the IT industry. With more than 25 years of its existence, Java most widely used platform for all kind of application development from website to mobile apps running of cell phones. 
Oracle offers certifications to certify the developers to give them recognition about their expertise in different areas of Java platform.

Since shifting the ownership from Sun to Oracle, the path of Java certifications is augmented. There is a change in the levels of examinations, their pre-requisite etc.There are lot of confusions about which exam to appear for and which not. In this blog, we are discussing such commonly asked questions which will be helpful to solve all such FAQs.  
I am confused between Oracle Certified Associate (OCA) and the Oracle Certified Professional (OCP). What are these exams ? 
The new structure of Oracle's Java Certification is bit confusing. Oracle have introduced 2 exams OCA and OCP. Lets try to get it clear: 
  • OCA is the entry-level cert for Java programmers. It is an excellent beginning point to study the very basics of the language. Normally this examination will cover basics of Object Oriented Programming questions of Java. 
  • OCP is the next-level cert for Java programmers. It’s a fairly more regular exam that deals with topics like generics,  design patterns, File I/O (NIO.2), threads, JDBC, and concurrency.
To be eligible for OCP one must certify OCA, this is clear-cut certification path. The above exams do not emphasis the versions as, though new versions of Java are published the earlier exams are still preserved by Oracle for many years. Which means that you can go for any of the version of your wish.
The following tables show the exams(with exam codes) you have to do to get the OCA and OCP for Java 7 and Java 8:
Certification
Exam
OCA
Oracle Certified Associate
1Z0-803
1Z0-808
OCP
Oracle Certified Professional
1Z0-804
1Z0-809
Why there are Two Exams?
Earlier in pre-Java 7 there was only one exam and certification was called Sun Certified Java Programmer (SCJP, exam code 310-065) initially and later changed to Oracle Certified Professional Java Programmer (OCPJP, exam code 1Z0-851). This was pretty simple, and the exam was covering almost all the topics excluding topics like JDBC etc. 

What was the reason to split the certification into two examinations? On the one hand, if you think of the extensive list of topics included in the Java 6 exam, it makes sense. With just one examination, getting the certification was an overwhelming task for many people. Having two tests allows you to establish more achievable goals and also to have a first accreditation (OCA) in less time. On the other hand, now the examinations are more difficult (higher passing score and less time per question) and altogether more expensive. Have a look at below table : 
(The prices shown in below table are current prices in INR as per the dollar rate.)
Exam
Price
Passing Score
Questions
Correct Answers to Pass Exam
Duration (Minutes)
Time Per Question
11000
61%
60
>=37
150
2:30
Java SE 8 Programmer I
11000
65%
80
>=52
150
1:53
Java SE 8 Programmer II
11000
65%
85
>=55
150

1:45
Should l I opt for Java 7 or Java 8 ?
I suggest you go for the Java 8 certification, since it’s comparatively new and will keep existence the latest version of the Java Programmer certification for at least three years. The additional content you must study for the Java 8 exam concerning the Java 7 examination is not that much and however worth preparation.
I Have a Java 6 or Java 7 Cert. What should be my next step?
This is really a most discussed question. As there are many of the developers who are already SCJP 5.0/6.0 or OCPJP 7.0 certified. Of course, there is not clear instructions on this from Oracle. This entirely depends on your aims and condition. My real suggestion is as mentioned below:
If you have a Java 6 accreditation, go for the Java 8 cert. The certification you have is suitable old, and altogether there have been significant add-ons to the Java language in its last two significant announcements.
If you have a Java 7 certification, go for the Java 9 cert. You still have a pretty recent accreditation, and the changes presented to the Java language in Java 8 are not that significant. You should also contemplate that these kinds of exams are comparatively costly and that preparing for them needs time and effort. So what I would do is just learn about Lambda expressions and the new calendar classes to keep your Java knowledge conversant.
I am an Experienced Developer. Should I opt for Oracle Java Certification?
Again this depends on your motivation towards certification and need of the industry you are working. Even if you are experienced developer, certification will always add the value to your career. This will certainly improve your career path in IT industry. There are many clients, who prefers the certified developers to work on their projects. So, it is always better to go for certification even if you are experienced. 
Do I Need to Pay for Training to Get My Java Cert?
This depends on your skills/expertise in Java. You can find out the good training organizations with certified trainers. Generally classroom training will vary from 20 to 30 hrs sessions for single exam. You can register for such training in the well known training institutes like SEED Infotech Ltd., 

For more details please visit : 
SEED Infotech Ltd., Shahupuri, Kolhapur 02312524501, 8975754386


Wednesday 14 March 2018

Why Java does not support multiple inheritance ?

Why Java does not support multiple inheritance ?

Many times this question will make you uncomfortable in Java interview. Though most of us know the rule of multiple inheritance, the reason behind this concept is not known to many of the students.

The above question in fact can be re-framed as,

"Why Java does not support multiple inheritance but can implement multiple interfaces?"


Traditionally when we do programming in c++, we have option of extending more than one classes and utilize the services from both the classes.so what's the advantages of this design in Java that a class can only extends one class ? Since interface is a pure kind of class(abstract class actually), why not limit the number of interfaces implementation just like class extension ?

Being able to extend only one base class is one way of solving the "dimond problem"

This is a problem which occurs when a class extends two base classes which both implement the same method. Then how do you know which one to call ?

A.java:


public class A {

    public int getValue() { return 0; }

}

B.java:

public class B {

    public int getValue() { return 1; }

}

C.java:


public class C extends A, B {

    public int doStuff() {

        return super.getValue(); // Which superclass method is called?

    }

}

Since interfaces cannot have implementations, this same problem does not arise. If two interfaces contain methods that have identical signatures, then there is effectively only one method and there still is no conflict.

Hope this makes sense !!

Education is a continuous process !!


Wednesday 21 February 2018

Ways to create objects in Java

Different ways to create objects in java


1. Using the new keyword

It is the most common and regular way to create an object and actually very simple one also. By using this method we can call whichever constructor we want to call (no-arg constructor as well as parametrised).

 Employee emp1 = new Employee(); 

2. Using Class.newInstance() method

We can also use the newInstance() method of the Class class to create objects, This newInstance() method calls the no-arg constructor to create the object.
We can create objects by newInstance() in following way.

Employee emp2 = (Employee) Class.forName("com.Employee").newInstance();

Or

Employee emp2 = Employee.class.newInstance();

3. Using newInstance() method of Constructor class

Similar to the newInstance() method of Class class, There is one newInstance() method in the java.lang.reflect.Constructor class which we can use to create objects. We can also call a parameterized constructor, and private constructor by using this newInstance() method.

Both newInstance() methods are known as reflective ways to create objects. In fact newInstance() method of Class class internally uses newInstance() method of Constructor class. That's why the later one is preferred and also used by different frameworks like Spring, Hibernate, Struts etc. 

Constructor<Employee> constructor = Employee.class.getConstructor();
Employee emp3 = constructor.newInstance();

4. Using clone() method

Whenever we call clone() on any object JVM actually creates a new object for us and copy all content of the previous object into it. Creating an object using clone method does not invoke any constructor.

To use clone() method on an object we need to implements Cloneable and define clone() method in it.

Employee emp4 = (Employee) emp3.clone();

Java cloning is the most debatable topic in Java community and it surely does have its drawbacks but it is still the most popular and easy way of creating a copy of any object until that object is full filling mandatory conditions of Java cloning.

5. Using deserialization

Whenever we serialize and then deserialize an object JVM creates a separate object for us. In deserialization, JVM doesn’t use any constructor to create the object.
To deserialize an object we need to implement the Serializable interface in our class.

ObjectInputStream in = new ObjectInputStream(new FileInputStream("data.obj"));
Employee emp5 = (Employee) in.readObject();





Saturday 17 February 2018

Does ArrayList in Java have default size?

Surprised ? Many developers might not aware of the fact that arraylist have some default size. Normally we consider arraylist with "0" size. Lets have a dig at the concept : 
ArrayList uses an array to store the elements. Arrays have a fixed size. The array that ArrayList uses has to have a default size, obviously. 10 is probably a more or less arbitrary number for the default number of elements. When you create a new ArrayList with nothing in it, then ArrayList will have made an array of 0 element, and when you add first element then it create array of 10 elements behind the scenes. Ofcourse those 9 elements are all null.
Using This line ...! 
List list=new ArrayList<String>();
Made an array of 0 element
list.add("FirstValue");
It create array of 10 elements behind the scenes with "FirstValue" at its 0 index.
Every time the array is full, ArrayList creates a new, larger array and copies the elements from the old array to the new array.

Note :- (copying the array time so better to think about its first)
if list.size == 9 and we do list.add("EleventhString")

It will create new array and copy all the data in newly created array.
The size of new arary depends on the current size of array and the algorithm is 
(CurrentSize of Array * 3/2) + 1

Wednesday 14 February 2018

Why Java declared String as immutable?

The Strings in java are immutable because they are stored in the "String Pool". The basic property of String pool is not to allow the "duplicate strings". 

i.e. if we declare,

String s1="abc"; 
String s2= "abc";

instead of 2 String objects only one String object will be created in String pool as content of both the Strings are equal. Ofcourse, this saves lot of memory at runtime. 

But because of this, there might be possibility that client1 changes the object referred by abc and client2, would get the modified String. So, to avoid this String objects are immutable in Java.

Another reason of why String class is immutable could die due to HashMap.

Since Strings are very popular as HashMap key, it's important for them to be immutable so that they can retrieve the value object which was stored in HashMap. Mutable String would produce two different hashcodes at the time of insertion and retrieval if contents of String was modified after insertion, potentially losing the value object in the map.

At the same time, String was made final so that no one can compromise invariant of String class e.g. Immutability, Caching, hashcode calculation etc by extending and overriding behaviors. 


Attend Online Java Certification Training and excel your career

Hello Java Developer,  Are you staying at home and worried about your future? Do not waste the time in worrying. International certifi...