Category: Java

  • All new features of java 8

    Look at the below list to know the all new features of java 8 A)Change in Language: 1.Lambda Expressions|Functional Programming Lambda expressions provide anonymous function types to Java – Replace use of anonymous inner classes – Provide more functional style of programming in Java

    2.Extension Methods|Bringing Multiple Inheritance (of Functionality) to Java Provide a mechanism […]

    Posted in: Java

  • JAVA to support determining the week of the year.

    Week of the year in JAVA Some applications, in their business logic, deal with the number of weeks in a year and the current week of the year. There are 52 weeks in a year, but 52 weeks multiplied by 7 days per week equals 364 days per year, not the actual 365 days. A week number is used […]

    Posted in: Java

  • JAVA & .NET which is the best

    Pros for Java: Java EE has better OR-support than .NET. JPA (Java Persistence API), Hibernate etc. .NET comes with Entity Framework, but it isn’t as lean as JPA. In .NET land there are some ports from Java available like e.g. NHibernate. .NET seems to more rely on stored procedures, whereby in Java we prefer (sometimes […]

    Posted in: Java

  • Java Graphics Class

    The Graphics Class Guys you can draw lines, shapes, characters, and images to the screen inside  your applet. Most of the graphics operations in Java are methods defined in the Graphics class. You don’t have to create an instance of Graphics in order to draw something in your applet; in your applet’s paint() method (which you learned about […]

    Posted in: Java

  • Use of the volatile variable in java

    Volatile in Java First, you have to understand a little something about the Java memory model.The best way I can think of to describe it is if you imagine it this way pointed as below : Each thread in Java takes place in a separate memory space (this is clearly untrue, so bear with me […]

    Posted in: Java

  • Lambda Expressions in Java

    Java is a first-class object-oriented language. With the exception of primitive data types, everything in Java is an object. Even an array is an Object. Every class creates instances that are objects. There is no way of defining just a function / method which stays in Java all by itself. There is no way of […]

    Posted in: Java

  • Resource Optimization with Java SE 7

    The typical Java application manipulates several types of resources such as files, streams, sockets, and database connections. Such resource optimization must be handled with great care, because they acquire system resources for their operations. Thus, you need to ensure that they get freed even in case of errors. Indeed, incorrect resource management is a common […]

    Posted in: Java

  • Inter-thread communication

    Inter-thread communication or Co-operation is all about allowing synchronized threads to communicate with each other. Cooperation (Inter-thread communication) is a mechanism in which a thread is paused running in its critical section and another thread is allowed to enter (or lock) in the same critical section to be executed.It is implemented by following methods of […]

    Posted in: Java

  • Deadlock in java

    Deadlock in java is a part of multithreading. Deadlock can occur in a situation when a thread is waiting for an object lock, that is acquired by another thread and second thread is waiting for an object lock that is acquired by first thread. Since, both threads are waiting for each other to release the […]

    Posted in: Java

  • Static synchronization

    If you make any static method as synchronized, the lock will be on the class not on object. Problem without static synchronization Suppose there are two objects of a shared class(e.g. Table) named object1 and object2.In case of synchronized method and synchronized block there cannot be interference between t1 and t2 or t3 and t4 […]

    Posted in: Java