Er Abhishek Kumar Agrahari

Welcome to csitquestions.com Best place to learn Engineering subjects like Java, C, DBMS,Operating System, DOS,Data Structure, HTML,CSS,AJAX .All For Free ..

Java Package

Package are used in Java, in-order to avoid name conflicts and to control access of class, interface and enumeration etc. A package can be defined as a group of similar types of classes, interface, enumeration and sub-package. Using package it becomes easier to locate the related classes. Package are categorized into two forms Built-in Package:-Existing …

Java Package Read More »

Interface In Java

Interface Interface is a pure abstract class.They are syntactically similar to classes, but you cannot create instance of an Interface and their methods are declared without any body. Interface is used to achieve complete abstraction in Java. When you create an interface it defines what a class can do without saying anything about how the …

Interface In Java Read More »

Nested Class

A class within another class is known as Nested class. The scope of the nested is bounded by the scope of its enclosing class. Static Nested Class A satic nested class is the one that has static modifier applied. Because it is static it cannot refer to non-static members of its enclosing class directly. Because …

Nested Class Read More »

String class function

String class function The following methods are some of the most commonly used methods of String class. charAt() charAt() function returns the character located at the specified index. String str = “studytonight”; System.out.println(str.charAt(2)); Output : u equalsIgnoreCase() equalsIgnoreCase() determines the equality of two Strings, ignoring thier case (upper or lower case doesn’t matters with this …

String class function Read More »

StringBuilder class

StringBuilder class StringBuilder is identical to StringBuffer except for one important difference it is not synchronized, which means it is not thread safe. Its because StringBuilder methods are not synchronised. StringBuilder Constructors StringBuilder ( ), creates an empty StringBuilder and reserves room for 16 characters. StringBuilder ( int size ), create an empty string and …

StringBuilder class Read More »

throw Keyword in java

the throw keyword is used to throw an exception explicitly. The only object of the Throwable class or its sub classes can be thrown. Program execution stops on encountering throw statement, and the closest catch statement is checked for a matching type of exception. Syntax : throw ThrowableInstance Creating Instance of Throwable class There are …

throw Keyword in java Read More »

Method Overriding with Exception Handling

There are few things to remember when overriding a method with exception handling. If super class method does not declare any exception, then sub class overriden method cannot declare checked exception but it can declare unchecked exceptions. Example of Subclass overriden Method declaring Checked Exception import java.io.*; class Super { void show() { System.out.println(“parent class”); …

Method Overriding with Exception Handling Read More »