400+ Java Q’s and A’s : Core Java, Servlets, JSP …and more

1. What are the four corner stones of OOP ?
Abstraction, Encapsulation, Polymorphism and Inheritance.

2. What do you understand by private, protected and public ?
These are accessibility modifiers. Private is the most restrictive, while public is the least restrictive. There is no real difference between protected and the default type (also known as package protected) within the context of the same package, however the protected keyword allows visibility to a derived class in a different package.

3. Difference between a Class and an Object ?
A class is a definition or prototype whereas an object is an instance or living representation of the prototype.

4. What is Downcasting ?
Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy.
5. What is Polymorphism ? What kinds ?

6. What is the difference between method overriding and overloading?
Overriding is a method with the same name and arguments as in a parent, whereas overloading is the same method name but different arguments.

7. What is the restriction on an Overridden methods’ accessibility ?
Overriding methods cannot reduce accessibility – they can either have same or greater accessibility.

8. What is the concept of a Virtual Function ?

9. What is the implication of a Virtual Destructor ? Virtual Constructor ?

10. Can a method be overloaded based on different return type but same argument type ?
No, because the methods can be called without using their return type in which case there is ambiquity for the compiler.

11. What is a “stateless” protocol ?
Without getting into lengthy debates, it is generally accepted that protocols like HTTP are stateless i.e. there is no retention of state between a transaction which is a
single request response combination.

12. What happens to a static var that is defined within a method of a class ?
Can’t do it. You’ll get a compilation error.

13. What is constructor chaining and how is it achieved in Java ?
A child object constructor always first needs to construct its parent (which in turn calls its parent constructor.). In Java it is done via an implicit call to the no-args
constructor as the first statement.

Link to Behavioural Interview Questions

14. How do you define a local inner class ?

15. How many static init can you have ?
As many as you want, but the static initializers and class variable initializers are executed in textual order and may not refer to class variables declared in the class whose
declarations appear textually after the use, even though these class variables are in scope.

16. What is passed by ref and what by value ?
All Java method arguments are passed by value. However, Java does manipulate objects by reference, and all object variables themselves are references.

17. How do you ensure size of a primitive data type ?
You can’t.

18. Describe the Garbage Collection process in Java ?
The JVM spec mandates automatic garbage collection outside of the programmers control. The System.gc() or Runtime.gc() is merely a suggestion to the JVM to run the

GC process but is NOT guaranteed.

19. What is the difference amongst JVM Spec, JVM Implementation, JVM Runtime ?
The JVM spec is the blueprint for the JVM generated and owned by Sun. The JVM implementation is the actual implementation of the spec by a vendor and the JVM

runtime is the actual running instance of a JVM implementation.

20. Can RMI and Corba based applications interact ?
Yes they can. RMI is available with IIOP as the transport protocol instead of JRMP

21 .What is the diffrence between an Abstract class and Interface ?
Ans ) Interface defines the methods. There is no implementation.
Whereas Abstract class may have few implemented methods.If some common functionality needs to be shared.

22. What is user defined exception ?
Ans )

23. What do you know about the garbate collector ?
Ans ) Java has an inbuilt mechanisim for garbage collection.
All those objects not longer being referenced are garbage collected.i.e the memory used by these objects is released.

24.What is the difference between C++ & Java ?
25.Explain RMI Architecture?
26.How do you communicate in between Applets & Servlets ?

27.What is the use of Servlets ?
Ans ) To generate dynamic content based on the request.

28.What is JDBC? How do you connect to the Database ?
Ans ) Java Database connectivity.
Using jdbc drivers provided by db drivers.

29.In an HTML form I have a Button which makes us to open another page in 15 seconds. How will do you that ?

30.What is the difference between Process and Threads ?
Ans ) There could be no of processes(multi tasking) and every process could have no of threads(multi threading).

31. What is the difference between RMI & Corba ?
Ans ) Remote method invocation : java only. uses JRMP to communication between java objects
Common object request broker architecture : platform independent. Uses IIOP to communicate between objects.

32.What are the services in RMI ?
33.How will you initialize an Applet ?
34.What is the order of method invocation in an Applet?
35.When is update method called ?

36.How will you pass values from HTML page to the Servlet ?
Ans ) submitting the html form.

37.Have you ever used HashTable and Dictionary ?
Ans ) Dictionary is an abstract class. Hastable extends Dictionary.

38.How will you communicate between two Applets ?
39.What are statements in JAVA ?

40.What is JAR file ?
Ans ) Jar file is an archive of java classes.

41.What is JNI ?
Ans ) Java Native interfaces.

42.What is the base class for all swing components ?
43.What is JFC ?
Ans ) Java Foundation classes.

44.What is Difference between AWT and Swing ?

45.Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times? Where 3 processes are started or 3 threads are started ?
Ans ) processes.

46.How does thread synchronization occurs inside a monitor ?
Ans ) A thread acquires the monitor.i.e it obtains a lock on the monitor.No other thread can acquire a lock on the same monitor until it is released by the previous thread.

47.What are 4 drivers available in JDBC ?
Ans ) jdbc-odbc bridge
Type 4 : pure java driver. no need to have db client installed on client mcs.

48.How you can know about drivers and database information ?
49.How will you perform transaction using JDBC ?
50.In RMI, server object first loaded into the memory and then the stub reference
is sent to the client ? or whether a stub reference is directly sent to the client ?
Suppose server object is not loaded into the memory, and the client request for it , what will happen?

51.What is serialization ?
Ans ) Process of persisting an object.

52.What is difference RMI registry and OSAgent ?

53.To a server method, the client wants to send a value 20,
with this value exceeds to 20, a message should be sent to the client ? What will you do for achieving for this ?

54 What are the benefits of Swing over AWT ?
55 Where the CardLayout is used ?
56 What is the Layout for ToolBar ?
57 What is the difference between Grid and GridbagLayout ?
58 How will you add panel to a Frame ?
59 What is the corresponding Layout for Card in Swing ?
60 What is light weight component ?
63 What is Servlet API used for conneting database ?
64 What is bean ? Where it can be used ?
65 What is difference in between Java Class and Bean ?
66 Can we send object using Sockets ?
67 What is the RMI and Socket ?
68 How to communicate 2 threads each other ?
72 What is the functionality stubs and skeletons ?
74 Diff between Application and Applet ?
75 What is serializable Interface ?
76 What is the difference between CGI and Servlet ?
77 What is the use of Interface ?
78 Why Java is not fully objective oriented ?
79 Why does not support multiple Inheritance ?
80 What it the root class for all Java classes ?
81 What is polymorphism ?
82 Suppose If we have variable ‘I’ in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?
83 In servlets, we are having a web page that is invoking servlets username and password ? which is cheks in the database ? Suppose the second page also If we want to
verify the same information whethe it will connect to the database or it will be used previous information?

90 What are session variable in Servlets ?
91 What is client server computing ?
93 Why we use OOPS concepts? What is its advantage ?
94 What is the middleware ? What is the functionality of Webserver ?
95 Why Java is not 100 % pure OOPS ?
96 When we will use an Interface and Abstract class ?
97 What is an RMI?
98 How will you pass parameters in RMI ? Why u serialize?
100 What is the main functionality of the Remote Reference Layer ?

find the cost of your paper

Sep 13, Grand Remembrances

Today is Grandparents Day in the United States. Being a Grand is a special honor. I feel very blessed that my wife and I have two grandchildren. We were able to visit them today. Yes, we are still being cautious with the coronavirus, but we also find it very difficult to not see them when they live so close. So today we did drop by to visit Jacob (age 10) and Sophia (age 7) along with their parents. We brought donuts and caught up with them. Our grandchildren are still pretty young and this is a precious time in their lives – and ours!

I wish I had known my grandparents better. We never lived in the same place. Dad was a career Air Force pilot, so we moved around a lot. But we did get to see them once in a while when they would visit us, or we them.

A Plague of Giants

There are five known magical ‘kennings’ or types: air, water, fire, earth, and plants. Each nation specializes in of these kennings, and the magic influences the society. There’s a big pitfall with this diversity of ability and locale–not everyone gets along.

Enter the Hathrim giants, or ‘lavaborn’ whose kenning is fire. Where they live the trees that fuel their fire are long gone, but the giants are definitely not welcome anywhere else. They’re big, they’re violent, and they’re ruthless. When a volcano erupts and they are forced to evacuate, they take the opportunity to relocate. They don’t care that it’s in a place where they aren’t wanted.

I first read Kevin Hearne’s Iron Druid books and loved them (also the quirky The Tales of Pell), so was curious about this new venture, starting with A PLAGUE OF GIANTS. Think Avatar: The Last Airbender meets Jim Butcher’s Codex Alera series. Elemental magic, a variety of races, different lands. And it’s all thrown at you from page one.

But this story is told a little differently. It starts at the end of the war, after a difficult victory, and a bard with earth kenning uses his magic to re-tell the story of the war to a city of refugees. And it’s this movement back and forth in time and between key players in this war that we get a singularly grand view of the war as a whole. Hearne uses this method to great effect.

There are so many interesting characters in this book that I can’t cover them all here. Often in books like this such a large cast of ‘main’ character can make the storytelling suffer, especially since they don’t have a lot of interaction with each other for the first 3/4 of the book–but it doesn’t suffer, thankfully. And the characterization is good enough, despite these short bursts, that by the end we understand these people and care about what happens to them.

If there were a main character it would be Dervan, a historian who is assigned to record (also spy on?) the bard’s stories. He finds himself caught up in machinations he feels unfit to survive. Fintan is the bard from another country, who at first is rather mysterious and his true personality is hidden by the stories he tells; it takes a while to understand him. Gorin Mogen is the leader of the Hathrim giants who decide to find a new land to settle. He’s hard to like, but as far as villains go, you understand his motivations and he can be even a little convincing. There’s Abhi, the son of hunters, who decides hunting isn’t the life for him–and unexpectedly finds himself on a quest for the sixth kenning. And Gondel Vedd, a scholar of linguistics who finds himself tasked with finding a way to communicate with a race of giants never seen before (definitely not Hathrim) and stumbles onto a mystery no one could have guessed: there may be a seventh kenning.

There are other characters, but what makes them all interesting is that they’re regular people (well, maybe not Gorin Mogen or the viceroy–he’s a piece of work) who become heroes in their own little ways, whether it’s the teenage girl who isn’t afraid to share vital information, to the scholars who suddenly find how crucial their minds are to the survival of a nation, to the humble public servants who find bravery when they need it most. This is a story of loss, love, redemption, courage, unity, and overcoming despair to not give up. All very human experiences by simple people who do extraordinary things.

Hearne’s worldbuilding is engaging. He doesn’t bottle feed you, at first it feels like drinking from a hydrant, but then you settle in and pick up things along the way. Then he shows you stuff with a punch to the gut. This is no fluffy world with simple magic without price. All the magic has a price, and more often than not it leads you straight to death’s door. For most people just the seeking of the magic will kill you. I particularly enjoyed the scenes with Ahbi and his discovery of the sixth kenning and everything associated with it. But giants? I mean, really? It isn’t bad enough fighting people who can control fire that you have to add that they’re twice the size of normal people? For Hearne if it’s war, the stakes are pretty high, and it gets ugly.

The benefit of the storytelling style is that the book, despite its length, moves along steadily (Hearne is no novice, here). The bits of story lead you along without annoying cliffhangers (mostly), and I never got bored with the switch between characters. It was easy to move between them, and they were recognizable enough that I got lost or confused. The end of the novel felt a little abrupt, but I guess that has more to do with I was ready for the story to continue, despite the exiting climax.

If you’re looking for epic fantasy with fun storytelling and clever worldbuilding, check out A PLAGUE OF GIANTS.

The post A Plague of Giants appeared first on Elitist Book Reviews.

The Artwork Of Gary Choo

Gary Choo is a concept artist/illustrator based in Singapore. I’ve know Gary for a good many years ( 17, actually ), working together in animation studios in Singapore like Silicon Illusions and Lucasfilm. Gary currently runs an art team at Mighty Bear Games, but when time allows he also draws covers for Marvel comics, and they’re amazing –

The Art Of Gary Choo
The Art Of Gary Choo
The Art Of Gary Choo
The Art Of Gary Choo
The Art Of Gary Choo

To see more of Gary’s work or to engage him for freelance work, head down to his ArtStation.

The post The Art Of Gary Choo appeared first on Halcyon Realms – Art Book Reviews – Anime, Manga, Film, Photography.

27