Constructors in Derived Classes

Constructors in Derived Classes

A constructor plays a vital role in initializing an object. An important note, while using constructors during inheritance, is that, as long as a base class constructor does not take any arguments, the derived class need not have a constructor function. However, if a base class contains a constructor with one or more arguments, then it is mandatory for the derived class to have a constructor and pass the arguments to the base class constructor. Remember, while applying inheritance, we usually cr

[ Read Constructors in Derived Classes ]

File Input/Output

File Input/Output

In C++, file input/output services are implemented through a component header file available in the C++ standard library. This header file is fstream.h . In C++, a file, at its lowest level, is interpreted simply as a sequence, or stream, of bytes. One aspect of the file I/O library manages the transfer of these bytes. At this level, the concept of a data type is absent. On the other hand, file, at the user level, consists of a sequence of possibly intermixed data types - characters, arithme

[ Read File Input/Output ]

NoClassDefFound

NoClassDefFound

NoClassDefFound means "No Class Definition Found". NoClassDefFound is an error from the JVM when it cannot find a class required to run a Java program. This error could be caused by an actual missing class, but it is usually caused by a faulty CLASSPATH. This error also sometimes occurs when Java users add the unnecessary .class extension to the end of their command lines: C:>java HelloWorld.class Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld/class C:

[ Read NoClassDefFound ]

cannot resolve symbol

cannot resolve symbol

"cannot resolve symbol" means that the Java compiler cannot locate a symbol referenced in your Java source code. The causes for this common error include: A missing class file A faulty CLASSPATH A symbol name is mispelled or miscapitalized A data type is incorrect, misspelled, or miscapitalized A method is called with the wrong number or types of arguments An undeclared variable cannot resolve symbol errors can be very difficult to track down. Code carefully!

[ Read cannot resolve symbol ]

break and continue Statements

break and continue Statements

break Statement The break statement is used to alter the flow of control. When a break statement is executed in a while loop, for loop, do-while loop or switch statement, it causes immediate exit from that statement. Program execution continues with the next statement. Common uses of the break statement are to escape early from a loop or to skip the remainder of a switch statement. The program written below demonstrates the break statement in a for-loop. When the if-statement detects that x h

[ Read break and continue Statements ]

Java Method

Java Method

Java Method is very much similar to a normal method or a function written within a class definition. Java method is basically a set of statements group together to perform a specific task. This method is included in a class. An object instantiated from a class can call methods of that class. Every Java method has a basic structure which must be followed to create any type of method. This structure of a Java method holds the following components: Method Header [Modifiers + Return Value Typ

[ Read Java Method ]

Java Servlet

Java Servlet

A Java Servlet is the Java technology used to extend and improve Web server functionality. Servlets are able to provide a platform independent way to build web-based applications founded upon components without the performance limitations found with comparable CGI applications. Since Java Servlets are platform and server independent, they can be deployed across the full range of web server technologies on the market and provide the full access to the Java programing language APIs to include JDBC

[ Read Java Servlet ]

Searching

Searching

Searching is the process of finding the location of a given element in a set of elements. The search is said to be successful if the given element is found i.e., the element does exist in the collection (such as an array); otherwise it is unsuccessful. Two simple approaches to searching are: Linear search: This method traverses a list sequentially to locate the search key. Binary search: This method works on sorted lists by progressively making better guesses to find the location of a s

[ Read Searching ]

SDLC Methodology

SDLC Methodology

SDLC (Systems Development Life Cycle) is the process of creating or modifying existing systems and the models and methodologies that are used in the process. In the fields of software engineering and information systems, SDLC denotes a framework of methodologies aimed at the creation of an information/software system, i.e. the software development process. SDLC covers many activities across well defined phases. These include questioning why the information system needs to be built, to chartin

[ Read SDLC Methodology ]

Java Operators

Java Operators

Java Operator Operator Description [ ] Array index () Method call . Member access ++ Prefix or postfix increment -- Prefix or postfix decrement + - Unary plus, minus ~ Bitwise NOT ! Boolean (logical) NOT (type) Type cast new Object creation * / % Multiplication, division, remainder + - Addition, subtraction + String concatenation << Signed bit shift left to right >> Signed bit shift rig

[ Read Java Operators ]

Page 1 of 91234Last »