Good morning Guyes,
Will you write some Java code today?
If you choose Java programming as your career, sooner or later you definitely have to learn and use frameworks. Think a framework like a platform on which you can build your applications easily and effortlessly.
Well, there are many frameworks out there for building Java applications such as Spring, Hibernate, Struts, Play, JSF, GWT, Vaadin, etc. But I have experience mainly in Spring, Hibernate and Struts so that today I’d love to share with Rajesh Bharti all my tutorials written for these frameworks:
• Spring tutorials: http://www.codejava.net/ frameworks/spring
• Hibernate tutorials: http://www.codejava.net/ frameworks/hibernate
• Struts tutorials: http://www.codejava.net/ frameworks/struts
If you are a beginner in these 3 frameworks, I recommend you start your journey with the following tutorials:
And you, which framework are you learning now?
Hi
This is me, Nam. How are you doing today?
Have you ever wondered that what is the official and latest source of information about Java technology?
Yeah, you may be able to guess what I’m talking about...
It’s the Java Magazine.
You know, I usually read the digital version of this magazine every month. And I really like it: professional design, high quality and up-to-date content from top experts.
So, if Rajesh Bharti really wants to be a world-class Java programmer, you should read this bi-monthly magazine.
Here are some reasons why you should read Java Magazine:
• It is published by Oracle - the steward of Java technology.
• It is written by the top gurus who work for big companies like Oracle, Google, IBM, etc.
• It covers the hottest and latest trends in the industry, so you always have up-to-date information.
• It’s absolutely FREE!
• And finally, I think this is the most important: It helps you see the big picture of Java technology and its ecosystem. When you see it, you will love Java more.
• It is written by the top gurus who work for big companies like Oracle, Google, IBM, etc.
• It covers the hottest and latest trends in the industry, so you always have up-to-date information.
• It’s absolutely FREE!
• And finally, I think this is the most important: It helps you see the big picture of Java technology and its ecosystem. When you see it, you will love Java more.
Do you remember the last element in my success formula? It’s LOVE!
Love Java,
Love Java,
Hello
How are you doing this weekend?
Today I’m very excited to introduce with you my latest video tutorial series that help you build a Java database-driven application with Swing and Hibernate framework.
You will be able to create a professional-looking program looks like this:
You will be able to create a professional-looking program looks like this:
Throughout 16 videos (8.5 hours of live coding), you will learn how to develop a Java application from A to Z: Analysis, Design, Code, Test and Package.
Watch the introductory video here:
ATTENTION: I may take this video down at any time, so watch it now as long as it is still available.
Click here: https://swing-hibernate- guide.gr8.com/
Click here: https://swing-hibernate-
What you will learn about Java Swing:
- Creating professional-looking, industry-standard desktop program
- How to use JFrame, JPanel, JTabbedPane, JDialog
- How to use JTable with custom table model
- How to use JMenuBar, JMenu, JMenuItem
- How to use JToolbar, JButton, JLabel, JTextField
- How to show message dialog & input dialog
- How to handle events
- How to use layout managers (GridBagLayout, FlowLayout, BorderLayout)
What you will learn about Hibernate Framework:
- Using Hibernate Configuration file (hibernate.cfg.xml)
- Mapping a one-to-many association using JPA annotations
- Writing Entity Classes
- Performing Create, Read, Update and Delete (CRUD) operations
- Coding General Data Access Object (DAO) class
For full details of what you can learn in this HD video series, check out this page:
Happy learning!
Rajesh Bharti
Hello
I cannot live without books'
- Thomas Jefferson, 3rd U.S. President
Hi Rajesh Bharti,
As I shared with you just some days ago, have you looked at my tutorials about Spring, Hibernate and Struts?
You know, frameworks are used every where to build professional applications, from desktop to web and to mobile. I bet you will need to learn and play with Spring, Hibernate and Struts at least one time in your life as a Java developer.
I also understand that my tutorials are not enough to feed your hunger of learning. So today I'm very eager to share with Rajesh Bharti the 8 latest books about the most popular Java frameworks which are trending now.
Here's exactly the books I want Rajesh Bharti to know:
In this list, you may not know some frameworks, so it's high time to take a look at these new ones to see the bigger picture.
I hope this helps you save your time on choosing the right books you need.
'I cannot live without books',
I hope this helps you save your time on choosing the right books you need.
'I cannot live without books',
Rajesh Bharti
Hello
Today I have great news for you, Rajesh Bharti!
Let me ask you some questions first:
- Have you ever wondered how to learn Java programming fast and effectively?
- Have you ever imagined having a guru who teaches you code Java professionally?
- Have you ever dreamed a friendly mentor whom you can ask any question related to Java programming?
My new Java Expert Course answers all the questions above.
My friend, I want to tell you this:
Don’t learn Java programming alone yourself! It’s very slow!
Let think in long term! You will waste a lot of time and money when self-learning Java programming. It’s like you have to find out how to control a car without going to a driving training center.
When it comes to Java programming, it’s smart to learn from a guru who is already expert in your field. It’s like you have a seasoned driver who can teach you everything about driving a car. That’s the value of my new Java Expert Course brings to you.
In this course, I will help you master Java programming within 365 days. You will be excellent in Java programming faster and easier. Really fast! Your friends and colleagues will be very surprised and admire you.
And most importantly, this course helps you save a lot of time and money in mastering Java programming in the long term.
Normally this course costs $98, but today I have a special offer for you - my friend:
- 85% OFF of the regular price: $98
- Today’s Special Price: $15
- This special offer is very limited: for the first 5 persons only!
- And this offer is ending in 3 days, until May 10th 2019
- PLUS 4 best Java e-books of all time: Head First Java, Effective Java, Head First Servlets and JSP, and Clean Code
So let take smart decision now:
Let see what other learners talked about this Java course:
- “Your course is awesome, just like you. Thank you very much Nam!” - Ivan Pashkulev from Sofia, Bulgaria.
- “Thank you Nam, your training are awesome!” - Paul Msegeya. From Dar Es Salaam, Tanzania.
- "Your lessons are great!" - Robert Antonovic. From Zagreb, Croatia.
- "From last two weeks I'm feeling motivated...I am getting better and better everyday" - Vishal Shah. From Vishrambag, Sangli, India.
- "I never seen such courses, so inspiring and motivational like you are conducting." - Shrinidhi Mahendrakar. From Bangalore, India.
To your success,
Rajesh Bharti
I just wake up and can't wait to write for you now, because the love story I told you yesterday really motivates me to help you get started with Spring framework effectively and joyfully!
My friend, I'm very happy that I can be your guide on your journey with Spring framework. If Rajesh Bharti is novice or a beginner, I recommend the following tutorials:
Let me tell you how to use these tutorials:
* If you are a kind of person who like understanding first, then doing later, you should read the first 3 tutorials which help you understand the core concepts, architecture and philosophy behind the framework.
* Or if Rajesh Bharti likes getting your hands dirty first when learning something new, let start with the tutorials #4 and #5. These hands-on tutorials help you create, build and run a Spring application step by step. And it's all easy to follow.
Happy learning, and
Have a great day!
Rajesh Bharti
Hi
Hi Rajesh Bharti,
Do you remember the first time you meet your girlfriend? Especially the first seconds you kiss her?
Let remember about those moments now.
Let remember about those moments now.
...
Are those the most memorable and thrilled moments in your life?
My friend, love is the greatest thing in our life. I wish your love will be lasting forever!
Well, today I want to tell you about my own love story.
But it's not about love with my girlfriend.
Neither about my boyfriend :))
Neither about my boyfriend :))
So read on to see who my love is for...
It was fall of 2009 when I had been working for my second company for about 6 months. I was assigned to work on a new project that involves in integrating between Spring and Flex frameworks.
I was a little bit worried because Spring and Flex are totally new things for me. Ah, it also uses Hibernate (and I didn't know Hibernate too).
Fortunately, the leader set up the project already, so my work is just to 'fill in the blanks'. For each business domain, I code the service, business and DAO layers with Spring and Hibernate. And the front-end is coded with Flex. It was the process of copy, paste, modify, test, fix and repeat so that I didn't understand much about the frameworks. But I was impressed with Spring because it does all the integration seamlessly.
I remember the project leader told me that Spring is powerful and is the most popular framework. So after completing the project, I decided to spend more and more time to discover and experiment on Spring.
I find books to read, follow online tutorials to code various examples. Read then code. Code then read. At this time, I feel enjoyable because each day I learned new things with Spring.
Then in the next year, I go to Freelancer.com to find some projects to practice what I had learned. Worked hard and seriously, I completed 3 or 4 projects and the great thing is that I got paid with kind comments from the customers. At this time, I feel exciting!
Then two years later, when I created the website CodeJava.net in early 2012, I decided that I will focus on sharing my experience in Spring development. And the result is over 30 tutorials published on the site. Many, many people leave good comments and say thanks to me so that I feel very happy. At this time, I love Spring!
Rajesh Bharti, that's my love story with Spring. During this journey, it has brought to me different emotional moments: worried, impressed, enjoyable, exciting and love.
I want to talk with you more, but it's too late today.
Good night
Good night
Rajesh Bharti
Hi
This is Rajesh Bharti. I hope you're always doing well :)
Today is weekend so I have some free time to surf the web while sipping some coffee. And I've stumbled upon this video:
Looks interesting, I thought. Then I watched it. And I watched again.
To be honest, it's a very inspirational video which features the history of computer software, so I can't wait to share this video with Rajesh Bharti.
Let take just about 10 minutes to watch it, because I believe that you will love and proud of what you are doing now: writing software programs!
Here's a message from the video which I really like:
'Writing new software is an act of human creativity. It's the highest of high-tech, and also... an art.'
More interestingly, the video also features an interview with Don Knuth - the programming pioneer and software legend. He's author of the very well-know book series The Art of Computer Programming.
Rajesh Bharti, what do you usually do at weekends? Why not try something new today by watching the video I've mentioned?
Have a great weekend!
Have a great weekend!
Dear Rajesh Bharti,
Today I would like to recommend you the best-selling Java course on Udemy:
Java Programming Masterclass for Software Developers
Over 317,801 students enrolled
Instructor has over 35 years experience as software developer
Are you aiming to get your first Java Programming job but struggling to find out what skills employers want and which course will give you those skills?
This course is designed to give you the Java skills you need to get a job as a Java developer. By the end of the course you will understand Java extremely well and be able to build your own Java apps and be productive as a software developer.
What you'll learn:
- Learn the core Java skills needed to apply for Java developer positions in just 14 hours.
- Be able to sit for and pass the Oracle Java Certificate exam if you choose.
- Be able to demonstrate your understanding of Java to future employers.
- Learn industry "best practices" in Java software development from a professional Java developer who has worked in the language for 18 years.
- Acquire essential java basics for transitioning to the Spring Framework, Java EE, Android development and more.
- Obtain proficiency in Java 8 and Java 11
See what your fellow students have to say:
"This course was a guiding light in my "Becoming a developer" path from the first step. It helped me become a much more educated developer comparing to my friend who learned to code from trial/error. It's still a guide for me. every now and then I will come back to this course to learn something new or to improve what I've learned somewhere else. A BIG Thanks to "Tim Buchalka" my Master." - Sina Jz
"I was an absolute beginner when I started this course, and now I can write some good small advanced clean codes. I wrote a code and showed it to a programmer, and he was shocked, he told me that I'm more than ready to start a programming career." - Amirreza Moeini
So it’s no doubt that this is the course you want, to become a Java developer.
And the most important news is, it is on SALE for just 11.99 USD. So click the following link to take this best-selling course at best price:
Java Programming Masterclass for Software Developers
11.99 USD – 23 hours left at this price!
Happy learning!
Rajesh Bharti
I think you have read the secret of a Java expert, right?
I’ve spent a long day to write that page for you. Why you can’t spend just 5 minutes to take a look?
Read it now:
Rajesh Bharti, do you believe me?
I don’t know whether you believe me or not…
But I really believe that you deserve to be healthy, happy, wealthy, and success in your life!
Let me tell you this… Read on!
I put my whole 10-year of experience into this new Java course, so that’s why:
- I truly believe that the course will help you to be an excellent Java programmer.
- I truly believe that I can help you advance your programming career.
- I truly believe that what you are missing now is a mentor who you can trust and follow.
- And I truly believe that I am the mentor you are looking for.
But I don’t believe that a smart person like you would refuse this opportunity.
Take this New Java Training Program now:
Rajesh Bharti, this new Java course is really awesome, so I really want you to join. Because:
- The sooner you join, the faster you succeed.
- The sooner you join, the more happiness you have.
- The sooner you join, the more money you will make.
Why I want you to take this course?
It’s simply because I want you to success! Your success is also my success!
One more thing…
One more thing…
If you don’t believe me, I have 60-day money back guarantee which protects you from losing your money you hard-earned.
So you have no risk at all. You have nothing to lose.
Rajesh Bharti, I really believe that this course will help you. If not, I’ll pay back every single cent you spend.
Why do you delay your success?
Take the course of your life now: http://secretofjavaexpert.gr8. com
Hello
Do you know how many guys asked me “What’s my secret to become excellent in Java programming”?
I think you really want to be a Java expert, right?
But…
Do you really know the secret to become a Java guru?
The secret is told here:
I bet you have never been told about this secret before. Because you are my friend and I really want you to be successful, I shared this page with you privately.
Read the secret now as that page can be taken down at anytime:
Hello
Do you remember my love story with Spring I shared with you last week? What do you think and how do you feel?
I hope that my story would inspire and motivate you to live and work relentlessly and happily.
Do your best and you will get the best!
Well, in my love story I mentioned that I read some books to learn Spring programming in the early days, but I didn't tell you any specific titles, right?
So today I'm happy to reveal the books I read during my journey with Spring. Here they are:
To be honest, the book I read the most is Spring in Action. For the other ones, I read only the chapters which I am interested such as Dependency Injection in Getting Started with Spring Framework; Spring Testing in Pro Spring 3; Integration with Java Message Service (JMS) in Spring Integration in Action...
You don't need to read the whole thick book. Just read the parts which you think necessary for you.
And there are other good books I haven't read but I think they maybe good for you. Perhaps you need them more than me. So I carefully list them on CodeJava.net in the following article:
Oh, I think that's enough. Do you remember I wrote 3 or 4 emails mentioning Spring, right?
Okay, so in the next few days, I will share more about core Java programming.
Have a great day!
Have a great day!
Hi Rajesh Bharti,
Today I would like to share with you some tutorials that help you create desktop applications in Java using Swing such as a sound recorder, a music player, a download/upload program, an email client, and more.
Hello World Swing Tutorials:
Fundamental Swing Tutorials:
Advanced Swing Tutorials:
Swing Projects Tutorials:
Happy coding!
Rajesh Bharti
Your Java Friend
P.S: You can read all Swing Tutorials on CodeJava.net here: https://www.codejava.net/java- se/swing
Hello
Haha haha haha…=)))
Do you know why I’m laughing, Rajesh Bharti?
Hahaha =))
I’ve just looked at some code I wrote 7 years ago and I cannot stop laughing. Haha…
Have you ever looked at your own code after some years?
I bet that would be very interesting and unforgettable moment.
Here’s a code snippet I wrote in 2008:
public class DatabaseSetup {
private Logger log = Logger.getLogger("com. hainasoft.nursery.db");
public void install(String dbName) throws DatabaseSetupException {
log.entering("DatabaseSetup", "install", dbName);
DBConnection dbConn = null;
dbConn = DBConnection.getInstance( dbName);
log.info("Get an instance of DBConnection");
try {
dbConn.connect(true);
log.info("Database " + dbName + " created");
} catch (DBConnectionException dbce) {
throw new DatabaseSetupException("Cannot create database");
}
DatabaseSchema dbSchema = new DatabaseSchema();
List listQueries = dbSchema.getQueries();
Statement statement = null;
try {
statement = dbConn.createStatement();
for (String sql : listQueries) {
statement.addBatch(sql);
}
int[] results = statement.executeBatch();
int count = 1;
for (int errorCode : results) {
if (errorCode >= 0) {
log.info("Query " + count + " executed successfully");
} else {
log.info("Query " + count + " failed to execute");
}
count++;
}
} catch (SQLException sqle) {
throw new DatabaseSetupException(" Database setup error");
}
log.exiting("DatabaseSetup", "install");
}
}
private Logger log = Logger.getLogger("com.
public void install(String dbName) throws DatabaseSetupException {
log.entering("DatabaseSetup", "install", dbName);
DBConnection dbConn = null;
dbConn = DBConnection.getInstance(
log.info("Get an instance of DBConnection");
try {
dbConn.connect(true);
log.info("Database " + dbName + " created");
} catch (DBConnectionException dbce) {
throw new DatabaseSetupException("Cannot create database");
}
DatabaseSchema dbSchema = new DatabaseSchema();
List listQueries = dbSchema.getQueries();
Statement statement = null;
try {
statement = dbConn.createStatement();
for (String sql : listQueries) {
statement.addBatch(sql);
}
int[] results = statement.executeBatch();
int count = 1;
for (int errorCode : results) {
if (errorCode >= 0) {
log.info("Query " + count + " executed successfully");
} else {
log.info("Query " + count + " failed to execute");
}
count++;
}
} catch (SQLException sqle) {
throw new DatabaseSetupException("
}
log.exiting("DatabaseSetup", "install");
}
}
Don’t worry, you don’t have to understand my code. I just showed off something I wrote 7 years ago.
Why does this code make me laughed?
Well, let me tell you a story of my own. Keep reading and you will know why.
Once upon a time, when I was a student learning programming in the college, I wrote many programs from alarm clock and fighting games to keyboard type training and mechanical movement simulation. All of those were really fun. I love programming so I feel very excited when I made a computer program.
Do you know how many people see my code? Only one - it’s me :D At this time, I had no idea about something like coding guidelines or code convention. Neither the professors nor the class mates told me. So I had been keeping my ‘amateur’ style of coding until I started working for my first company.
It was in 2005. I worked in a team of 7 people in a software development department. There are 4 programmers including me.
After some days getting acquainted with the job, the leader gives me a PDF document and said that I must read it and apply what I learn into writing code. And you know, that was the first time I read the ‘Java Code Conventions’ document.
To be honest, it’s a quite boring stuff (not funny and interesting like Head First Java). So I was a little bit reluctant in applying the code conventions to our company’s project. Anyway, it still made my code looks better than the years I was in the college: more readable, more structured and more beautifully :)
But I had not realized the importance of code conventions until on a fine day… A team mate was ill and I had to take over his task because the demo day is getting close. When reading his code to continue his work, I realized that this guy didn’t follow the code conventions. Needless to say, his code is rubbish (sorry I don’t want to offend him): badly organized, meaningless names, spaces and blank lines are put arbitrarily, etc.
So it’s not easy for me to understand the logic he implemented. I remember I had to talk several minutes with him over the phone to clarify what he did. Wow, I was very upset!
From that day, I really realized the importance of adhering to code conventions in team work. If every team member obeys the one standard strictly, then it would be easy and effortlessly for others who will have to maintain someone else’s code in the future.
Keeping that in mind, I always follow code conventions when writing code, even in my personal projects. And when I’m a leader, I also push my team to adhere to code conventions strictly. It may be hard from the beginning, but once you make it becomes your habit, it’s just like breathing in and breathing out.
Rajesh Bharti, the way you write code would tell about yourself more than you think. It determines you as an amateur, a professional or an expert. If you see my code on CodeJava.net or in my projects you will see that I always follow the same code conventions. That’s the style of a Java professional.
So I think you have figured out my message through my story. If you haven’t known or adhered to code conventions, I strongly recommend you read the document ‘Java Code Conventions’ from Oracle. It’s free and you can either download the PDF version or read it online.
Here’s the link to download ‘Java Code Conventions’:
Although this document is out-dated (written during 1997-1999), but the majority conventions are still valid today.
And lastly, why I laughed when I see my 7 years old code?
It’s because over the time, you accumulate more experiences and wisdom, thus you know how to do things better than you did yesterday. If I’m given a chance to re-write the code above, I would write differently and more professionally.
Thanks for reading my story.
Talk soon,
Thanks for reading my story.
Talk soon,
rajeshbharti muzaffarpur facebook.com
A Java Professional (and a Code-Conventions-aware guy).
P.S: When you hate what you wrote yesterday, then you are better than yesterday. Congratulations!
A Java Professional (and a Code-Conventions-aware guy).
P.S: When you hate what you wrote yesterday, then you are better than yesterday. Congratulations!
P.P.S: In my course javatipseveryday.com, I will share more about code conventions in-depth.
I hope you like the Java quiz I asked you 3 days ago. There will be more and tougher quizzes in the next few days.
But today I want to tell you about 3 rules you may not know before. Read on and you will see.
Do you understand the following code snippet (version #1)?
class MyProgram {
int calculate(int number1, int number2) {
return 2 * (number1 + number2);
}
}
int calculate(int number1, int number2) {
return 2 * (number1 + number2);
}
}
I think you can guess the purpose of this code easily. Does it return a double of sum of two given numbers, doesn’t it?
But wait, what does that really mean?
But wait, what does that really mean?
What is the purpose of such calculation?
What does the method ‘calculate’ really means?
And what is the meaning of the class ‘MyProgram’?
Let me tell you the intention of the programmer who wrote this code: He wanted to calculate perimeter of a rectangle. That’s it!
But you don’t know that, do you? Me too.
What does the method ‘calculate’ really means?
And what is the meaning of the class ‘MyProgram’?
Let me tell you the intention of the programmer who wrote this code: He wanted to calculate perimeter of a rectangle. That’s it!
But you don’t know that, do you? Me too.
The fact is, that code looks seemingly fine but it doesn’t tell what it really means to be.
Rajesh Bharti, that’s the problem I want to talk with you today: ambiguous naming because of negligent coding style.
Rajesh Bharti, that’s the problem I want to talk with you today: ambiguous naming because of negligent coding style.
To be honest, I had this problem too. During my programming career, I see that many guys (especially the novice or beginner) take the naming of identifiers lightly.
Their code seems to look okay and works perfectly as expected. But let’s imagine on a nice day, some other guys have to look at their code. These new comers cannot easily understand the code as they read it. Ironically, some weeks or months later, the author won’t understand what he wrote as well!
Imagine you are working on a project with thousands lines of code. More problems will come when the project goes into maintenance or upgrade phases. It’s even worse when new programmers join the project in place of the out-going guys. And because the new comers feel difficult to understand the project, they tend to break it and decide to start coding over. That would be a waste of time and money.
Remember, the less clarity of the code, the more time to maintain it.
And because time is money, the more time to maintain, the higher the cost of the project.
And because time is money, the more time to maintain, the higher the cost of the project.
So today, I want to share with Rajesh Bharti how to name identifiers properly, correctly and professionally like the experts. Here, identifiers include names of class, method, variable, parameter and enum in Java.
Why naming is so important in coding, and why we should not take it lightly? Because we name classes, variables and methods everywhere and every time we write code. Basically, our code consists of names, names, and names.
Fortunately, good naming is not difficult if you know the ways. There are 3 primary rules when it comes to name an identifier:
1) Meaningful
2) Descriptive
3) Succinct
2) Descriptive
3) Succinct
Let’s look at each rule now.
* Rule #1: NAMES SHOULD BE MEANINGFUL
* Rule #1: NAMES SHOULD BE MEANINGFUL
An identifier should have a meaningful name. That means the name should be a single English word or a compound word. The words should have some meaning to human.
For example, the parameter names number1 and number2 in the above code are not meaningful. They should be renamed as width and height as the purpose of the method is to find perimeter of a rectangle.
Here are some bad names: name1, name2, test1(), test2().
And here are the good ones: firstName, lastName, testSave(), testDelete().
NOTE: there are some exceptions, for example the names: i, j, x, y, a, b.
And here are the good ones: firstName, lastName, testSave(), testDelete().
NOTE: there are some exceptions, for example the names: i, j, x, y, a, b.
These names are very common and have implicit meanings:
• i, j: counters in loop constructs such as for, do and while.
• x, y: coordinate of a point.
• a, b: two operands of a mathematical operation.
• i, j: counters in loop constructs such as for, do and while.
• x, y: coordinate of a point.
• a, b: two operands of a mathematical operation.
* Rule #2: NAMES SHOULD BE DESCRIPTIVE
Name of an identifier should be self-explanatory. That means you don’t have to write any extra comments to explain its purpose. The name should describe itself perfectly.
For example, the method name ‘calculate’ is quite generic. It’s better to be renamed to ‘calculatePerimeter’ or ‘findPerimiter’ in the context of the above code.
Here’s a tip to check whether a name is descriptive or not: as long as you have to write comments to explain the purpose of a name, you are having a non-descriptive name. For example:
// this class is for calculation of perimeter of a rectangle
class MyProgram { ... }
class MyProgram { ... }
And how about this:
class RectangleUtil { ... }
So which one would you choose? Of course it is the latter, right? It’s because the name RectangleUtil is more descriptive as you don’t have to write any comments to explain it.
Remember to always name your identifiers descriptively, or in other words, self-explanatory.
Here are some bad names: MyApplication, TestApplication
And here are the good ones: StudentManager, FileWriterTest
And here are the good ones: StudentManager, FileWriterTest
* Rule #3: NAMES SHOULD BE SUCCINCT
Your identifier names are meaningful and descriptive. That’s very good, but they should be long enough to be perfect.
A too short name lacks of descriptive, for example: calculate.
A too long name is too verbose unnecessarily, for example:
A too long name is too verbose unnecessarily, for example:
calculateDoubleOfSumOfWidthAnd Height()
Look, this method name is very descriptive, but too verbose. It should be re-written as:
calculatePerimeter()
So remember: neither too short nor too verbose is good. It should be harmony in terms of both meaningful and descriptive.
So far I have shared with Rajesh Bharti the 3 rules when it comes to name identifiers. These rules are not only specific to Java but it’s also for programming in general.
Finally, by applying the 3 rules mentioned above, the code snippet which I showed before can be re-written like this (version #2):
class RectangleUtil {
int calculatePerimeter(int width, int height) {
return 2 * (width + height);
}
}
int calculatePerimeter(int width, int height) {
return 2 * (width + height);
}
}
Now, let’s compare the two versions: version #1 and version #2. Which one is better, more readable, more understandable and self-explanatory?
Remember, we put names everywhere, so let’s make them meaningful, descriptive and succinct.
Happy weekend, Rajesh Bharti.
Programming with Web Services is one of the most important skills which every Java programmer should acquire today.
There are many ways you can learn Java web services, but one of the best ways I would like to recommend with you today is from this course on Udemy:
(Bestseller in Web Services - 22,401 students enrolled)
Why do I recommend this course for you? Simply it is currently the Best-Selling course on Java Web Services.
Here’s what you will learn:
- Understand why web services are so popular
- Understand the different types of WS Design
- Use Apache CXF the Popular WS Stack
- Implement Contract First and Code First Web Services
- Develop a Web Service Consumer
- Secure Web Services using the WS-Security Standard
- Implement SOAP Attachments
- Master the REST web service concepts and Implementation
- Create different types of REST Clients
- Secure Rest Services
- Handle Errors in REST
- Develop Asynchronous Web Services
- Jersey REST Quick Start
- Spring MVC REST Quick Start
- Learn all the important web services interview Questions and Answers
- Use REST Attachments
Let see some students have to say:
“Excellent course for people who want to learn web services in java. I have explored many courses on web services but this is the best one. Take this course without giving any second thought.” - Himanshu Sukhija
“He is a great teacher. He helped me understand SOAP and REST web services through his comprehensive lectures.” - Dimitris Gravos
“I really enjoyed taking this course. The concepts were very well explained with walking though the examples. I have already recommended the course to several other people. Well done Bharath!” - Jeffery Noonon
So if you’re looking of learning web services programming with Java, this course is what you need.
And the most important news is, it is on SALE for just 12.99 USD. So click the following link to take this best-selling course at best price:
12.99 USD – only 12 hours left at this price!
hi
Dear Rajesh Bharti,
Do you want to Learn to Build Amazing REST API with Spring Boot? Do you want to learn what the Hype about Microservices is all about? Do you want to Build Microservices with Spring Boot and Spring Cloud? Look no Further!
Today I’d like to recommend you a best-selling course to learn Microservices with Spring Boot – the two hot programming trends in the industry:
Master Microservices with Spring Boot and Spring Cloud
(An awesome journey from Restful Web Services to Microservices with Java, Spring Boot and Spring Cloud)
Here’s exactly what you will learn in this course:
- You will be able to develop and design RESTful web services with Spring Boot
- You will be able develop MICROSERVICES with Spring Boot and Spring Cloud
- You will understand How to IMPLEMENT Exception Handling, Validation, HATEOAS and filtering for RESTful Web Services.
- You will implement client side load balancing (Ribbon), Dynamic scaling (Eureka Naming Server) and an API Gateway (Zuul)
- You will setup Centralized Microservices Configuration with Spring Cloud Config Server
- You will learn to implement Distributed tracing for microservices with Spring Cloud Sleuth and Zipkin
- You will implement Fault Tolerance for microservices with Hystrix
- You will understand how to version your RESTful Web Services
- You will understand how to monitor RESTful Services with Spring Boot Actuator
- You will understand how to document RESTful Web Services with Swagger
- You will understand the best practices in designing RESTful web services
- Using Spring Cloud Bus to exchange messages about Configuration updates
- Simplify communication with other Microservices using Feign REST Client
And let’s see what students have to say:
“Anyone willing to learn Spring Cloud API's and Spring Rest must enroll for the course without second-thoughts.”
“Probably I can say this is best tutorial for Spring boot as well as Micro Service for the learners who have just started their work/projects on these technologies.”
“This was an excellent course! The instructor provided great examples that were straight-forward and easy to understand… I would highly recommend his courses if you want to solid introduction to spring boot and the spring framework.”
And the most important news is, it is on SALE for just 11.99 USD. So click the following link to take this best-selling course at best price:
Master Microservices with Spring Boot and Spring Cloud
(11.99 USD – 24 hours left at this price!)
Enroll this course now to expand your skillset in Microservices and Spring Boot.
hi
ood morning Rajesh Bharti,
It’s still Nam - your friend.
Have you ever made these mistakes in Java programming? What are the reasons and how to avoid making these mistakes again?
1. Accessing non-static members from static methods (mostly from the main method)
Novice programmers often make this mistake as they don’t fully understand the differences between static and non-static stuffs in Java. And interestingly, this mistake mostly happens in the static method main() where one attempts to access an instance variable or method. Read More…
2. Missing closing curly braces
This is also a common mistake which one writes an opening curly brace (the { ) but forget to put a closing one (the } ). A closing curly brace is often missed due to improper indentation of the code, or due to putting the open brace without closing it immediately. Read More…
3. Missing break in switch case construct
Novice programmers often misses a break in the switch case construct which does not cause compile error but makes the code runs wrongly. It’s because the switch case construct in Java has a feature called ‘fall through’ in which the code execution continues to the next case if there is no break in the current case. Read More…
4. Confusing assignment with comparison (= and ==)
The = is an assignment operator whereas the == is a relational operator, and sometimes one mistakenly uses = instead of ==. Read More…
5. Confusing object comparison (== instead of .equals)
The == operator compares two objects physically (their memory addresses) whereas the equals() method compares two objects semantically (their information). And in most of the cases, we should compare two objects meaningfully using the equals() method. Read More…
Don’t be afraid to make mistakes, as we grow by learning lessons from mistakes.
I also summarize other 5 common mistakes in the following article:
Take a look to check if you ever made the same mistakes and how to avoid making those again.
How are you doing today?
Do you remember that I told you about the 13 tasks you should practice in order to be a good programmer? If you do remember, one important task is reading books, right?
Yeah, that’s true. Reading books definitely help you become a good programmer.
But look…
You should read the right books!
So what are the best books that help you to be superior in programming?
The good news is, you won’t have to find such books yourself. You don’t have to waste time, as today I’m going to share with you the more complete list of books.
Rajesh Bharti, I want to tell you this…
The following list collects the best books covering almost aspects in today’s modern programming, from data structure to refactoring, from clean code to complete code, from unit testing to agile development, from releasing and shipping your software to continuous delivery, from pragmatic to passionate. Almost everything you need to learn to be superior in programming.
And here’s the list:
1. The Pragmatic Programmer
2. The Passionate Programmer
3. The Clean Coder
4. Code Complete
5. Coders at Work
6. The Art of Computer Programming
7. The Mythical Man-Month
8. Structure and Interpretation of Computer Programs
9. Refactoring: Improving the Design of Existing Code
10. Working Effectively with Legacy Code
11. Continuous Delivery
12. Release It!
13. Ship It!
14. The Art of Agile Development
15. xUnit Test Patterns
2. The Passionate Programmer
3. The Clean Coder
4. Code Complete
5. Coders at Work
6. The Art of Computer Programming
7. The Mythical Man-Month
8. Structure and Interpretation of Computer Programs
9. Refactoring: Improving the Design of Existing Code
10. Working Effectively with Legacy Code
11. Continuous Delivery
12. Release It!
13. Ship It!
14. The Art of Agile Development
15. xUnit Test Patterns
What a wonderful list of best books!
So you have the list. What should you do now?
Here’s my suggestion:
- Pick 5 books in which you are interested the most, then plan to read them in one year. That means you read each book in every 2 months. I think this is very reasonable schedule, even you are busy.
- Choose one of the 5 books above and plan to read it from now during 2 months.
- Apply what you learn to your daily work.
- Stick with your plan.
So let tell me your plan of reading this year, Rajesh Bharti.
To Your Success,
Rajesh Bharti
Hi
Today I’d like to share with u some of my experiences in database programming with Java or JDBC (Java Database Connectivity). If you work with Java but haven’t touched JDBC, it’s like you have a girlfriend but haven’t touched her…hand.
In my opinion, programming with JDBC is pretty easy, as long as you understand its nuts and bolts.
Can you spot the differences between these two statements?
Class.forName(“com.mysql.jdbc. Driver”);
and:
Driver driver = new com.mysql.jdbc.Driver();
These two statements have same purpose: create an instance of the JDBC driver for MySQL database. However the first one is more flexible as you don’t have to hard-code the driver class name and don’t have to add reference to the corresponding JDBC driver library (although it should be present in the classpath).
And one interesting point is that, since JDBC 4.0 (Java 6), this kind of statement is not necessary as the JDBC driver manager can automatically detect and load the appropriate driver based on URL connection. For example:
String url = “jdbc:mysql://localhost:3306/ mydb”;
String username = “root”;
String password = “secret”;
Connection connection = DriverManager.getConnection( url, username, password);
String username = “root”;
String password = “secret”;
Connection connection = DriverManager.getConnection(
Over the past few years, I gathered my experiences in JDBC programming in the following tutorials which help you get started with database programming in Java more easily and effortlessly:
1. Summary of JDBC URL patterns for common databases:
2. Summary of JDBC Driver downloads for common databases:
3. JDBC CRUD (Create-Read-Update-Delete) Tutorial:
4. Connect to MySQL:
5. Connect to SQL Server:
6. Connect to SQLite:
7. Connect to Oracle:
8. Connect to Apache Derby:
9. Connect to PostgreSQL:
10. Connect to MongoDB:
You can also find other JDBC-related tutorials here:
And other useful resources:
• JDBC Homepage: http://www.oracle.com/ technetwork/java/javase/tech/ index-jsp-136101.html
• JDBC API (Javadocs): http://docs.oracle.com/javase/ 7/docs/api/java/sql/package- summary.html
• JDBC Basics in the Java Tutorials: http://docs.oracle.com/javase/ tutorial/jdbc/basics/index. html
• JDBC API (Javadocs): http://docs.oracle.com/javase/
• JDBC Basics in the Java Tutorials: http://docs.oracle.com/javase/
Hi
Dear All,
Today I have a very special offer for you:
You can enroll in my Java Expert Course at only 15 USD (the normal fee is 98 USD) - You save 89%!
This offer will be closed in next 24 hours, so don’t miss this chance to invest for your programming career.
In this course, I will help you master Java programming within 365 days. You will be excellent in Java programming faster and easier. Really fast! Your friends and colleagues will be very surprised and admire you.
Enroll this course here (click JOIN NOW button)
And most importantly, this course helps you save a lot of time, money and effort in mastering Java programming in the long term.
Imagine you will have a personal coach for Java programming.
Here’s what you will learn about Java in this course during one year:
- Setup Development Environment
- The Java Language Fundamentals
- Object-Oriented Programming
- Generics and Collections
- Exception Handling
- Java File I/O System
- Concurrency (Multi-Threading)
- Network Programming
- Java Database Connectivity (JDBC)
- Java Swing & Java FX
- Servlets & JSPs; Java Web Services
- Design Patterns
- Frameworks (Spring, Hibernate, Struts and JavaServer Faces)
- Advanced Java Topics
- Analysis & Design
- and much more.
Besides learning technical skills, you will also learn how to prepare for your career development, learning method tips, how to get Java Certifications, and how to work as a freelancer - get your first job!
And this is the best of this course: There are hundreds of questions and exercises at every weekend that help you improve your hands-on experience with Java. In addition, I will give you 100 project assignments to enhance your programming skills.
John, Imagine you will become a Java expert after 365 days by learning directly and deeply from me.
Your boss, you friends and your colleagues will be impressed with your whole new Java programming skills.
Your boss, you friends and your colleagues will be impressed with your whole new Java programming skills.
Here’s what other learners talked about this Java course (474 programmers already enrolled):
- “Your course is awesome, just like you. Thank you very much Nam!” - Ivan Pashkulev from Sofia, Bulgaria.
- “Thank you Nam, your training is awesome!” - Paul Msegeya. From Dar Es Salaam, Tanzania.
- "Your lessons are great!" - Robert Antonovic. From Zagreb, Croatia.
- "From last two weeks I'm feeling motivated...I am getting better and better everyday" - Vishal Shah. From Vishrambag, Sangli, India.
- "I never seen such courses, so inspiring and motivational like you are conducting." - Shrinidhi Mahendrakar. From Bangalore, India.

I learned all about computer science from Extramarks to improve my concepts and queries of this subject. The website has all the cbse class 8 computer science chapter wise explanation which helped me in understanding the concepts much better.
ReplyDeletehttps://www.Extramarks.com/ncert-solutions/cbse-class-8/computer-science
thaks a lot where r u from
Deletethaks a lot where r u from
Delete