The real time issues while developing the java based applications. All question while learning the java. You can ask more question in comment and can expect the answers for it.
What are the predefined abstract classes in Java?
Get link
Facebook
X
Pinterest
Email
Other Apps
-
What are the predefined abstract classes in Java?
There are many but some of them are AbstractMap<K,V>, AbstractMap<K,V>,AbstractCollection<E>,AbstractList<E> ext.
Main method not found in class Test, please define the main method as: public static void main(String[] args) Ans. Check the main method with argument type String[].
How do I create an array of a string? Here is the example code. public class ArrayDemo { public static void main(String[] args) { String[] strArray = new String[2]; strArray[0] = "Hello"; strArray[1] = "World !"; System.out.println(strArray[0] +" "+strArray[1]); } } Output: Hello World !
Explain briefly about POJO in Java? POJO is Plain old java object. The class with its private attributes and the having the getter and setter method. these methods are public so any class from out side can access this attributes via the methods only not directly. Example : import java.util.Date; public class Student { private int id; private String name; private Date dob; public Date getDob() { return dob; } public void setDob(Date dob) { this.dob = dob; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } Here you can see the Student class POJO with id , name and DOB attributes and having the getter and setter methods.
Comments
Post a Comment