Inheritance is an object oriented feature supported by Java wherein the features of one Java class can be inherited/made available in another class. This creates a parent child relationship between these 2 classes. Class Inheritance in java mechanism is used to build new classes from existing classes. The inheritance relationship is transitive: if class x extends class y, then a class z, which extends class x, will also inherit from class y. Object-oriented programming allows classes to inherit commonly used state and behavior from other classes.
Example:
public class Parent {
private String name = "Rocky";
public String getName(){
return this.name;
}
}
public class Child extends Parent {
public static void main(String[] args){
System.out.println("Name in Parent is: " + getName());
}
}
Here the getName() method is available only in the parent class but is directly used in the child class because the method is public and is directly accessible to the child class since it has extended the parent class.
Benefits of Inheritance:
One of the key benefits of inheritance is to minimise the amount of duplicate code in an application by sharing common code amongst several subclasses. Where equivalent code exists in two related classes, the hierarchy can usually be refactored to move the common code up to a mutual superclass. This also tends to result in a better organisation of code and smaller, simpler compilation units.
Inheritance can also make application code more flexible to change because classes that inherit from a common superclass can be used interchangeably. If the return type of a method is superclass
Why should image files on webpages be compressed?
So that the image downloads quicker in your browser. File size is important in web design and every element of your page has a file size which adds to total download time.
What potential problems could we did not have the W3C?
No communication means no business, exchanging infromation or data equal zero.
What is the difference in size between a webpage and a HTML document?
Very simply, a website is a collection of one or more web pages designed to convey information on a particular subject or theme to a web user. (e.g. a company will have a web site providing structured information about the company, designed to inform particular groups of its stakeholders - investors, customers, technical support, sales, employment, news items etc.)
A web page is one screen full of information (from a web site) that may contain links to other pages in the web site or links to external information. The web page will normally be written as (or rendered as) an HTML document.
What program do you use to open HTML documents?
You can open them with different things. A browser will display the web page. Any text editor should be able to open the actual file so you can see the code. Anything that can open a text file, like a word processor, will open a html file. Specialise html editors and programs like Dreamweaver can also open html documents.
What is the standard magazine font size?
There is no default font size, that is up to the browser.
The author of an HTML page can use CSS or HTML to specify a font size, but the browser can still override the author's wishes, for example if the user has set the browser to display extra large text.
navigation in HTML means the user movement around a website using links,
by inserting links into your HTML code as below, you give the user the ability to move from one page to another,
<a href="page1.HTML">go to page 1</a>
this will show as a link like: go to page 1
when you click on it you will go to: page1.HTML
You can also add links using images like so,
<a href="page1.HTML"><img src="imagename.jpg" /></a>
this will show imagename.jpg and when clicked on you will go to: page1.HTML
How do you create a scrolling text box using HTML while including variables such as appearance.?
Use a textarea instead of a textbox
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="fer">
<style>
.txtareaclss {background-color:black; color:green;font-size:20px; font-family:Tahoma;}
</style>
</head>
<body>
<form name="myform" method="" action="">
<textarea class="txtareaclss" name="mytxtarea" cols="50" rows="10">
</textarea>
</form>
</body>
</html>
How are opening and closing tags different?
An opening tag is used to indicate the starting point of an action by a tag. The closing tag shows when to stop this action. The front slash is added to a tag, before the tagname, to indicate that it is a closing tag. What is between the tags is effectively selected for this action. To start bolding for example, we use <b> and to stop we use </b> as follows:
This text is <b> bold </b> text.
The word bold in the above sentence would be bolded, as that is what is enclosed by the opening and closing tags. The text outside of that is as normal.
What HTML character symbolizes that the tag is a closing tag?
You are probably referring to the front slash. It, along with the less than sign and the greater than sign and the name of the tag, form an end tag, like this:
</html>
The opening tag does not have the front slash, so it is the character that makes the difference.
Nobody knows for certain who came up with it first. Some say the cavemen or the Chinese, but there seems to be no credible proof of that. The only original source for the idea of the Chinese inventing it and playing the game in a macabre sort of way comes from a movie.
But what we do know is that the game is at least 600 years old. Three Africans, Adelin Zika, Micheal Hud and Kirit Kam, are credited for having invented it.
Augustus Hagerson adapted and popularized the sport in Africa in 1832 and spread the sport to Guam in 1833.
Others claim it began in the US in 1920 by an independent invention. Two men, Walter Young and Philip Livingston, returned from World War I and found work in a factory. They engaged in horseplay at work by throwing a foam ball at each other. One day, the foam ball got into a machine and came out with a fine layer of rubber on it. They were fired for this, but the ball inspired them to create a new sport. While this new sport caught on in Akron, Ohio and surrounding areas, there was little interest beyond Ohio. However, it seems the US Department of Education quickly picked up the game and introduced it as part of physical education in public schools.
What is horizontal tag in HTML?
The tag
Why do images not show up on webpage?
There are several reasons that this could be:
1) There is no internet connection
2) the domain has expired
3) the hosting has expired
4) the server is down
5) temporary gliche
What is the HTML code for enter?
Use <br /> for a new line. Use <p></p> for a new paragraph.
or if you want to link to a website or another page you put
<html>
<body>
<a href="the page or site you want to link">button text here</a>
</body>
</html>
What HTML tag would you use to indicate a line break?
A
tag is used to insert a line break. This tag is the HTML way of outputting a new line.
Advanatges and Disadvantages of Microsoft Front Page?
Advantages of Web Publishing and Marketing
Disadvantages of web publishing and marketing
How can you align the text in a cell?
Left - aligns everything to the left
Right - aligns everything to the right
Centre - aligns everything to the middle
Justify - stretches the text so it lines up at each margin
What is the expansion for HREF code?
HTML- HyperTextMarkup Language..... HTML is used for creating web pages for example...
How do you upload an image in HTML code?
First add image (.jpg, .png, .gif) into 'images' folder in main root of the site. In HTML code add <img alt="word or phrase describing image" height="162" src="path where image is coming from images/img.gif" width="917" />
How do you save a text file as HTML?
go to file menu--> select option "save as" --> then choose the file type "html document" name the file. and you are done
Can you insert an image in table header in HTML?
Yes, you can insert an image anywhere in the code. You just have to insert the img tag before the area you want to insert it.