Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Java Questions ??  RSS feed

Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one answer these interview questions
1). how do we get multiple return values from a method?
2). is it possible to lock a file using java?
3.) how do we get unsigned ints in java?
4.) define in java derived class which can draw a red border itself?
5.) what is normalization and denormalization?
can some body answer these questions. thankyou
Posts: 3226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't it be better for you and your prospective employer if you'd learn the answers to those questions by studying Java first?
Don't you know that an employee can be fired from his/her new job when the employer realizes that s/he doesn't know enough to be kept on the job?
I would not take that risk. I'd be sure I studied enough for the technical interview and that I understood at least the basic concepts.
Did you pass the SCPJ2?

Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I think your questions are thought-provoking.
1).Maybe you return an array, vector, or some other data structures? Or maybe changing values within the method?
2).The only "lock" I know of in Java is that of Object and class locks in synchronized methods/blocks. Maybe you can check out Java API.
3).Maybe you can use char as unsigned ints. But that would probably require you to know the unicode table.
4).All classes in Java are derived. Maybe you just extend a Border(ie LineBorder) class.
5).No idea.
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

5. Not sure if this a question for Java Programmers - normalization and denormalization usually refers to data design.
Excerpted from
What is data normalization?
Data normalization is the process of successively reducing a given collection of relations to some more desirable form. The normalization process is reversible (a process of no-loss decomposition). More simply, normalization is the process of re-arange data relationships so that it will be easy to store and retrieve data efficiently.

Why should one normalize?
Data is normalized to achieve the following goals:
Eliminate data redundancies and save space
Make it easier to change data
Simplify the enforcement of referential integrity constraints
Avoid modification anomalies. For example, an insertion anomaly occurs when the insertion of a fact about one attribute requires an additional fact about a second attibute.
Produce a design that is a 'good' representation of the real world (one that is intuitively easy to understand and a good base for further growth)

How does one normalize data?
A database is normalized if it comply to the following rules:
1st Normal Form
Definition: Non-key attribute in a table should be functionally dependent on the whole key.
Action: Remove repeating groups
2nd Normal Form
Definition: 1stNF, plus every non-key attribute is functionally dependent on the full key and .
Action: Remove partial dependancies
3rd Normal Form
Definition: 2ndNF, plus every non-key attribute should be functionally dependent on the full key and nothing but the full key
Action: Remove transitive dependencies.
There are also 4th and 5th normal forms, but their definitions are of academic concern only, and are rarely required for practical purposes.

When should one denormalize the design?
One should denormalize the design when:
All queries require access to the "full" set of joined data.
The majority of applications scan entire tables doing joins.
Computational complexity of derived columns require storage for SELECTs
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!